[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y
Chris Lattner
lattner at cs.uiuc.edu
Fri Aug 22 19:52:05 PDT 2003
Changes in directory llvm/lib/AsmParser:
llvmAsmParser.y updated: 1.118 -> 1.119
---
Log message:
Accept double quoted strings everwhere we accept a %ABC variable name.
This introduces one more innoculous shift-reduce conflict, but will REALLY
help the type names generated by the C++ frontend, which wants to use all
kinds of crazy stuff.
---
Diffs of the changes:
Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.118 llvm/lib/AsmParser/llvmAsmParser.y:1.119
--- llvm/lib/AsmParser/llvmAsmParser.y:1.118 Mon Aug 18 09:29:26 2003
+++ llvm/lib/AsmParser/llvmAsmParser.y Fri Aug 22 00:42:10 2003
@@ -698,8 +698,8 @@
%token <PrimType> VOID BOOL SBYTE UBYTE SHORT USHORT INT UINT LONG ULONG
%token <PrimType> FLOAT DOUBLE TYPE LABEL
-%token <StrVal> VAR_ID LABELSTR STRINGCONSTANT
-%type <StrVal> OptVAR_ID OptAssign FuncName
+%token <StrVal> VAR_ID LABELSTR STRINGCONSTANT
+%type <StrVal> Name OptName OptAssign
%token IMPLEMENTATION ZEROINITIALIZER TRUE FALSE BEGINTOK ENDTOK
@@ -728,7 +728,6 @@
// Handle constant integer size restriction and conversion...
//
-
INTVAL : SINTVAL;
INTVAL : UINTVAL {
if ($1 > (uint32_t)INT32_MAX) // Outside of my range!
@@ -762,7 +761,7 @@
FPType : FLOAT | DOUBLE;
// OptAssign - Value producing statements have an optional assignment component
-OptAssign : VAR_ID '=' {
+OptAssign : Name '=' {
$$ = $1;
}
| /*empty*/ {
@@ -1246,9 +1245,10 @@
// Rules to match Function Headers
//===----------------------------------------------------------------------===//
-OptVAR_ID : VAR_ID | /*empty*/ { $$ = 0; };
+Name : VAR_ID | STRINGCONSTANT;
+OptName : Name | /*empty*/ { $$ = 0; };
-ArgVal : Types OptVAR_ID {
+ArgVal : Types OptName {
if (*$1 == Type::VoidTy)
ThrowException("void typed arguments are invalid!");
$$ = new std::pair<PATypeHolder*, char*>($1, $2);
@@ -1281,9 +1281,7 @@
$$ = 0;
};
-FuncName : VAR_ID | STRINGCONSTANT;
-
-FunctionHeaderH : TypesV FuncName '(' ArgList ')' {
+FunctionHeaderH : TypesV Name '(' ArgList ')' {
UnEscapeLexed($2);
std::string FunctionName($2);
@@ -1409,7 +1407,7 @@
SymbolicValueRef : INTVAL { // Is it an integer reference...?
$$ = ValID::create($1);
}
- | VAR_ID { // Is it a named reference...?
+ | Name { // Is it a named reference...?
$$ = ValID::create($1);
};
More information about the llvm-commits
mailing list