aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-02-08 00:19:40 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-02-08 00:19:40 +0000
commit49b8b55c29e2733f9b15872509319f22de72415e (patch)
tree187e26216de66a3d1ac70900e57d836bf497afd2
parentf36c7b860de5cae1ffc817fce430210e942a0bf7 (diff)
For PR1187:
Allow @ before identifer names. Recognize the i1, i8, i16, i32, i64 keywords as type names corresponding to bool, ubyte, ushort, uint, and ulong respectively. While these aren't LLVM 1.9 constructs, permitting the syntax allows post-1.9 assembly files to be upgraded. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34023 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/llvm-upgrade/UpgradeLexer.l9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/llvm-upgrade/UpgradeLexer.l b/tools/llvm-upgrade/UpgradeLexer.l
index f2757c45db..ebab6db9c0 100644
--- a/tools/llvm-upgrade/UpgradeLexer.l
+++ b/tools/llvm-upgrade/UpgradeLexer.l
@@ -152,14 +152,14 @@ using namespace llvm;
Comment ;.*
/* Variable(Value) identifiers start with a % sign */
-VarID %[-a-zA-Z$._][-a-zA-Z$._0-9]*
+VarID [%@][-a-zA-Z$._][-a-zA-Z$._0-9]*
/* Label identifiers end with a colon */
Label [-a-zA-Z$._0-9]+:
QuoteLabel \"[^\"]+\":
/* Quoted names can contain any character except " and \ */
-StringConstant \"[^\"]*\"
+StringConstant @?\"[^\"]*\"
/* [PN]Integer: match positive and negative literal integer values that
@@ -240,14 +240,19 @@ x86_fastcallcc { return X86_FASTCALLCC_TOK; }
sbyte { RET_TY(SBYTE, Type::Int8Ty, Signed); }
ubyte { RET_TY(UBYTE, Type::Int8Ty, Unsigned); }
+i8 { RET_TY(UBYTE, Type::Int8Ty, Unsigned); }
short { RET_TY(SHORT, Type::Int16Ty, Signed); }
ushort { RET_TY(USHORT, Type::Int16Ty, Unsigned); }
+i16 { RET_TY(USHORT, Type::Int16Ty, Unsigned); }
int { RET_TY(INT, Type::Int32Ty, Signed); }
uint { RET_TY(UINT, Type::Int32Ty, Unsigned); }
+i32 { RET_TY(UINT, Type::Int32Ty, Unsigned); }
long { RET_TY(LONG, Type::Int64Ty, Signed); }
ulong { RET_TY(ULONG, Type::Int64Ty, Unsigned); }
+i64 { RET_TY(ULONG, Type::Int64Ty, Unsigned); }
void { RET_TY(VOID, Type::VoidTy, Signless ); }
bool { RET_TY(BOOL, Type::Int1Ty, Unsigned ); }
+i1 { RET_TY(BOOL, Type::Int1Ty, Unsigned ); }
float { RET_TY(FLOAT, Type::FloatTy, Signless ); }
double { RET_TY(DOUBLE, Type::DoubleTy,Signless); }
label { RET_TY(LABEL, Type::LabelTy, Signless ); }