mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
For PR1553:
Make the AsmParser auto-upgrade the old zext and sext keywords for parameter attributes and handle the end-of-line ambiguity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40610 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6f62af6e64
commit
1d3d230861
@ -177,6 +177,8 @@ HexFPConstant 0x[0-9A-Fa-f]+
|
|||||||
*/
|
*/
|
||||||
HexIntConstant [us]0x[0-9A-Fa-f]+
|
HexIntConstant [us]0x[0-9A-Fa-f]+
|
||||||
|
|
||||||
|
/* WSNL - shorthand for newline followed by whitespace */
|
||||||
|
WSNL [ \r\t\n]*$
|
||||||
%%
|
%%
|
||||||
|
|
||||||
{Comment} { /* Ignore comments for now */ }
|
{Comment} { /* Ignore comments for now */ }
|
||||||
@ -234,6 +236,10 @@ noreturn { return NORETURN; }
|
|||||||
noalias { return NOALIAS; }
|
noalias { return NOALIAS; }
|
||||||
byval { return BYVAL; }
|
byval { return BYVAL; }
|
||||||
nest { return NEST; }
|
nest { return NEST; }
|
||||||
|
sext{WSNL} { // For auto-upgrade only, drop in LLVM 3.0
|
||||||
|
return SIGNEXT; }
|
||||||
|
zext{WSNL} { // For auto-upgrade only, drop in LLVM 3.0
|
||||||
|
return ZEROEXT; }
|
||||||
|
|
||||||
void { RET_TY(Type::VoidTy, VOID); }
|
void { RET_TY(Type::VoidTy, VOID); }
|
||||||
float { RET_TY(Type::FloatTy, FLOAT); }
|
float { RET_TY(Type::FloatTy, FLOAT); }
|
||||||
|
@ -1225,7 +1225,9 @@ OptCallingConv : /*empty*/ { $$ = CallingConv::C; } |
|
|||||||
};
|
};
|
||||||
|
|
||||||
ParamAttr : ZEROEXT { $$ = ParamAttr::ZExt; }
|
ParamAttr : ZEROEXT { $$ = ParamAttr::ZExt; }
|
||||||
|
| ZEXT { $$ = ParamAttr::ZExt; }
|
||||||
| SIGNEXT { $$ = ParamAttr::SExt; }
|
| SIGNEXT { $$ = ParamAttr::SExt; }
|
||||||
|
| SEXT { $$ = ParamAttr::SExt; }
|
||||||
| INREG { $$ = ParamAttr::InReg; }
|
| INREG { $$ = ParamAttr::InReg; }
|
||||||
| SRET { $$ = ParamAttr::StructRet; }
|
| SRET { $$ = ParamAttr::StructRet; }
|
||||||
| NOALIAS { $$ = ParamAttr::NoAlias; }
|
| NOALIAS { $$ = ParamAttr::NoAlias; }
|
||||||
|
12
test/Assembler/2007-07-30-AutoUpgradeZextSext.ll
Normal file
12
test/Assembler/2007-07-30-AutoUpgradeZextSext.ll
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
; Test that upgrading zext/sext attributes to zeroext and signext
|
||||||
|
; works correctly.
|
||||||
|
; PR1553
|
||||||
|
; RUN: llvm-as < %s > /dev/null
|
||||||
|
|
||||||
|
define i32 @bar() {
|
||||||
|
%t = call i8 @foo( i8 10 sext ) zext
|
||||||
|
%x = zext i8 %t to i32
|
||||||
|
ret i32 %x
|
||||||
|
}
|
||||||
|
|
||||||
|
declare i8 @foo(i8 signext ) zeroext
|
Loading…
x
Reference in New Issue
Block a user