Make the %"..." syntax legal for local name. This just makes it symmetric

with global names which can already be @"..."


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37257 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2007-05-19 07:21:26 +00:00
parent a2b18de4ba
commit aa7c2f8c03
2 changed files with 9 additions and 2 deletions

View File

@ -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);

View File

@ -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