summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-07-31 02:57:37 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-07-31 02:57:37 +0000
commitd45d07ac7267276d74ae5b357d842df548fd741a (patch)
tree985e2b311a3d74573303b31198125677238a43c0 /llvm/lib
parent7d165e1d84453e02be4c7808667896150e19d0e8 (diff)
downloadbcm5719-llvm-d45d07ac7267276d74ae5b357d842df548fd741a.tar.gz
bcm5719-llvm-d45d07ac7267276d74ae5b357d842df548fd741a.zip
For PR1553:
Make the AsmParser auto-upgrade the old zext and sext keywords for parameter attributes and handle the end-of-line ambiguity. llvm-svn: 40610
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/AsmParser/Lexer.l6
-rw-r--r--llvm/lib/AsmParser/llvmAsmParser.y2
2 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/AsmParser/Lexer.l b/llvm/lib/AsmParser/Lexer.l
index 6b8bba5d68d..19be3dc3b49 100644
--- a/llvm/lib/AsmParser/Lexer.l
+++ b/llvm/lib/AsmParser/Lexer.l
@@ -177,6 +177,8 @@ HexFPConstant 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 */ }
@@ -234,6 +236,10 @@ noreturn { return NORETURN; }
noalias { return NOALIAS; }
byval { return BYVAL; }
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); }
float { RET_TY(Type::FloatTy, FLOAT); }
diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y
index 0cc7a9831a2..fd2713f3071 100644
--- a/llvm/lib/AsmParser/llvmAsmParser.y
+++ b/llvm/lib/AsmParser/llvmAsmParser.y
@@ -1225,7 +1225,9 @@ OptCallingConv : /*empty*/ { $$ = CallingConv::C; } |
};
ParamAttr : ZEROEXT { $$ = ParamAttr::ZExt; }
+ | ZEXT { $$ = ParamAttr::ZExt; }
| SIGNEXT { $$ = ParamAttr::SExt; }
+ | SEXT { $$ = ParamAttr::SExt; }
| INREG { $$ = ParamAttr::InReg; }
| SRET { $$ = ParamAttr::StructRet; }
| NOALIAS { $$ = ParamAttr::NoAlias; }
OpenPOWER on IntegriCloud