mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
Parse
%b = getresult {i32, i32} %a, i32 1 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47349 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -598,6 +598,7 @@ int LLLexer::LexIdentifier() {
|
|||||||
INSTKEYWORD("extractelement", OtherOpVal, ExtractElement, EXTRACTELEMENT);
|
INSTKEYWORD("extractelement", OtherOpVal, ExtractElement, EXTRACTELEMENT);
|
||||||
INSTKEYWORD("insertelement", OtherOpVal, InsertElement, INSERTELEMENT);
|
INSTKEYWORD("insertelement", OtherOpVal, InsertElement, INSERTELEMENT);
|
||||||
INSTKEYWORD("shufflevector", OtherOpVal, ShuffleVector, SHUFFLEVECTOR);
|
INSTKEYWORD("shufflevector", OtherOpVal, ShuffleVector, SHUFFLEVECTOR);
|
||||||
|
INSTKEYWORD("getresult", OtherOpVal, GetResult, GETRESULT);
|
||||||
#undef INSTKEYWORD
|
#undef INSTKEYWORD
|
||||||
|
|
||||||
// Check for [us]0x[0-9A-Fa-f]+ which are Hexadecimal constant generated by
|
// Check for [us]0x[0-9A-Fa-f]+ which are Hexadecimal constant generated by
|
||||||
|
@ -1093,6 +1093,7 @@ Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
|
|||||||
// Other Operators
|
// Other Operators
|
||||||
%token <OtherOpVal> PHI_TOK SELECT VAARG
|
%token <OtherOpVal> PHI_TOK SELECT VAARG
|
||||||
%token <OtherOpVal> EXTRACTELEMENT INSERTELEMENT SHUFFLEVECTOR
|
%token <OtherOpVal> EXTRACTELEMENT INSERTELEMENT SHUFFLEVECTOR
|
||||||
|
%token <OtherOpVal> GETRESULT
|
||||||
|
|
||||||
// Function Attributes
|
// Function Attributes
|
||||||
%token SIGNEXT ZEROEXT NORETURN INREG SRET NOUNWIND NOALIAS BYVAL NEST
|
%token SIGNEXT ZEROEXT NORETURN INREG SRET NOUNWIND NOALIAS BYVAL NEST
|
||||||
@ -1733,7 +1734,7 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr
|
|||||||
GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
|
GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription());
|
||||||
const PointerType *Ty = dyn_cast<PointerType>($1->get());
|
const PointerType *Ty = dyn_cast<PointerType>($1->get());
|
||||||
if (Ty == 0)
|
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
|
// ConstExprs can exist in the body of a function, thus creating
|
||||||
// GlobalValues whenever they refer to a variable. Because we are in
|
// GlobalValues whenever they refer to a variable. Because we are in
|
||||||
@ -3130,6 +3131,14 @@ MemoryInst : MALLOC Types OptCAlign {
|
|||||||
$$ = new StoreInst($3, tmpVal, $1, $7);
|
$$ = new StoreInst($3, tmpVal, $1, $7);
|
||||||
delete $5;
|
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 {
|
| GETELEMENTPTR Types ValueRef IndexList {
|
||||||
if (!UpRefs.empty())
|
if (!UpRefs.empty())
|
||||||
GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
|
GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription());
|
||||||
|
Reference in New Issue
Block a user