mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Make the %"..." syntax legal for local name. This just makes it symmetric
with global names which can already be @"..." llvm-svn: 37257
This commit is contained in:
parent
dda5066a5e
commit
b3bb24667a
@ -161,6 +161,7 @@ QuoteLabel \"[^\"]+\":
|
||||
/* Quoted names can contain any character except " and \ */
|
||||
StringConstant \"[^\"]*\"
|
||||
AtStringConstant @\"[^\"]*\"
|
||||
PctStringConstant %\"[^\"]*\"
|
||||
|
||||
/* LocalVarID/GlobalVarID: match an unnamed local variable slot ID. */
|
||||
LocalVarID %[0-9]+
|
||||
@ -366,6 +367,11 @@ shufflevector { RET_TOK(OtherOpVal, ShuffleVector, SHUFFLEVECTOR); }
|
||||
return ATSTRINGCONSTANT;
|
||||
}
|
||||
|
||||
{PctStringConstant} {
|
||||
yytext[strlen(yytext)-1] = 0; // nuke end quote
|
||||
llvmAsmlval.StrVal = strdup(yytext+2); // Nuke @, quote
|
||||
return PCTSTRINGCONSTANT;
|
||||
}
|
||||
{PInteger} { int len = strlen(yytext);
|
||||
uint32_t numBits = ((len * 64) / 19) + 1;
|
||||
APInt Tmp(numBits, yytext, len, 10);
|
||||
|
@ -1051,7 +1051,8 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) {
|
||||
%token <PrimType> FLOAT DOUBLE LABEL
|
||||
%token TYPE
|
||||
|
||||
%token<StrVal> LOCALVAR GLOBALVAR LABELSTR STRINGCONSTANT ATSTRINGCONSTANT
|
||||
%token<StrVal> LOCALVAR GLOBALVAR LABELSTR
|
||||
%token<StrVal> STRINGCONSTANT ATSTRINGCONSTANT PCTSTRINGCONSTANT
|
||||
%type <StrVal> LocalName OptLocalName OptLocalAssign
|
||||
%type <StrVal> GlobalName OptGlobalAssign GlobalAssign
|
||||
%type <UIntVal> OptAlign OptCAlign
|
||||
@ -1138,7 +1139,7 @@ FPredicates
|
||||
IntType : INTTYPE;
|
||||
FPType : FLOAT | DOUBLE;
|
||||
|
||||
LocalName : LOCALVAR | STRINGCONSTANT;
|
||||
LocalName : LOCALVAR | STRINGCONSTANT | PCTSTRINGCONSTANT
|
||||
OptLocalName : LocalName | /*empty*/ { $$ = 0; };
|
||||
|
||||
/// OptLocalAssign - Value producing statements have an optional assignment
|
||||
|
Loading…
Reference in New Issue
Block a user