[llvm-commits] [llvm] r47349 - in /llvm/trunk/lib/AsmParser: LLLexer.cpp llvmAsmParser.y
Devang Patel
dpatel at apple.com
Tue Feb 19 14:26:37 PST 2008
Author: dpatel
Date: Tue Feb 19 16:26:37 2008
New Revision: 47349
URL: http://llvm.org/viewvc/llvm-project?rev=47349&view=rev
Log:
Parse
%b = getresult {i32, i32} %a, i32 1
Modified:
llvm/trunk/lib/AsmParser/LLLexer.cpp
llvm/trunk/lib/AsmParser/llvmAsmParser.y
Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=47349&r1=47348&r2=47349&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLLexer.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLLexer.cpp Tue Feb 19 16:26:37 2008
@@ -598,6 +598,7 @@
INSTKEYWORD("extractelement", OtherOpVal, ExtractElement, EXTRACTELEMENT);
INSTKEYWORD("insertelement", OtherOpVal, InsertElement, INSERTELEMENT);
INSTKEYWORD("shufflevector", OtherOpVal, ShuffleVector, SHUFFLEVECTOR);
+ INSTKEYWORD("getresult", OtherOpVal, GetResult, GETRESULT);
#undef INSTKEYWORD
// Check for [us]0x[0-9A-Fa-f]+ which are Hexadecimal constant generated by
Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=47349&r1=47348&r2=47349&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original)
+++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Tue Feb 19 16:26:37 2008
@@ -1093,6 +1093,7 @@
// Other Operators
%token <OtherOpVal> PHI_TOK SELECT VAARG
%token <OtherOpVal> EXTRACTELEMENT INSERTELEMENT SHUFFLEVECTOR
+%token <OtherOpVal> GETRESULT
// Function Attributes
%token SIGNEXT ZEROEXT NORETURN INREG SRET NOUNWIND NOALIAS BYVAL NEST
@@ -1733,7 +1734,7 @@
GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
const PointerType *Ty = dyn_cast<PointerType>($1->get());
if (Ty == 0)
- GEN_ERROR("Global const reference must be a pointer type");
+ GEN_ERROR("Global const reference must be a pointer type " + (*$1)->getDescription());
// ConstExprs can exist in the body of a function, thus creating
// GlobalValues whenever they refer to a variable. Because we are in
@@ -3130,6 +3131,14 @@
$$ = new StoreInst($3, tmpVal, $1, $7);
delete $5;
}
+| GETRESULT Types LocalName ',' ConstVal {
+ ValID TmpVID = ValID::createLocalName(*$3);
+ Value *TmpVal = getVal($2->get(), TmpVID);
+ if (!GetResultInst::isValidOperands(TmpVal, $5))
+ GEN_ERROR("Invalid getresult operands");
+ $$ = new GetResultInst(TmpVal, $5);
+ CHECK_FOR_ERROR
+ }
| GETELEMENTPTR Types ValueRef IndexList {
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
More information about the llvm-commits
mailing list