1
0
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:
Reid Spencer 2007-05-19 07:21:26 +00:00
parent dda5066a5e
commit b3bb24667a
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