summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-07-10 07:15:17 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-07-10 07:15:17 +0000
commitdb82d2f33827dc44dc0076ad26a1a0f4638719c5 (patch)
tree426d1932604bec0dc540456540d91402c644e66a /llvm/lib/AsmParser
parent0f70ee9017d080e5a068647a8e3717c483c4c51b (diff)
downloadbcm5719-llvm-db82d2f33827dc44dc0076ad26a1a0f4638719c5.tar.gz
bcm5719-llvm-db82d2f33827dc44dc0076ad26a1a0f4638719c5.zip
Revert the new EH instructions
This reverts commits r241888-r241891, I didn't mean to commit them. llvm-svn: 241893
Diffstat (limited to 'llvm/lib/AsmParser')
-rw-r--r--llvm/lib/AsmParser/LLLexer.cpp7
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp161
-rw-r--r--llvm/lib/AsmParser/LLParser.h9
-rw-r--r--llvm/lib/AsmParser/LLToken.h4
4 files changed, 1 insertions, 180 deletions
diff --git a/llvm/lib/AsmParser/LLLexer.cpp b/llvm/lib/AsmParser/LLLexer.cpp
index 69c2048aae2..88f359d4fd5 100644
--- a/llvm/lib/AsmParser/LLLexer.cpp
+++ b/llvm/lib/AsmParser/LLLexer.cpp
@@ -524,7 +524,6 @@ lltok::Kind LLLexer::LexIdentifier() {
KEYWORD(undef);
KEYWORD(null);
KEYWORD(to);
- KEYWORD(caller);
KEYWORD(tail);
KEYWORD(musttail);
KEYWORD(target);
@@ -749,12 +748,6 @@ lltok::Kind LLLexer::LexIdentifier() {
INSTKEYWORD(extractvalue, ExtractValue);
INSTKEYWORD(insertvalue, InsertValue);
INSTKEYWORD(landingpad, LandingPad);
- INSTKEYWORD(cleanupret, CleanupRet);
- INSTKEYWORD(catchret, CatchRet);
- INSTKEYWORD(catchblock, CatchBlock);
- INSTKEYWORD(terminateblock, TerminateBlock);
- INSTKEYWORD(cleanupblock, CleanupBlock);
- INSTKEYWORD(catchendblock, CatchEndBlock);
#undef INSTKEYWORD
#define DWKEYWORD(TYPE, TOKEN) \
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 05373bf05d9..91a88bc91fd 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -4489,12 +4489,6 @@ int LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB,
case lltok::kw_indirectbr: return ParseIndirectBr(Inst, PFS);
case lltok::kw_invoke: return ParseInvoke(Inst, PFS);
case lltok::kw_resume: return ParseResume(Inst, PFS);
- case lltok::kw_cleanupret: return ParseCleanupRet(Inst, PFS);
- case lltok::kw_catchret: return ParseCatchRet(Inst, PFS);
- case lltok::kw_catchblock: return ParseCatchBlock(Inst, PFS);
- case lltok::kw_terminateblock: return ParseTerminateBlock(Inst, PFS);
- case lltok::kw_cleanupblock: return ParseCleanupBlock(Inst, PFS);
- case lltok::kw_catchendblock: return ParseCatchEndBlock(Inst, PFS);
// Binary Operators.
case lltok::kw_add:
case lltok::kw_sub:
@@ -4888,161 +4882,6 @@ bool LLParser::ParseResume(Instruction *&Inst, PerFunctionState &PFS) {
return false;
}
-bool LLParser::ParseExceptionArgs(SmallVectorImpl<Value *> &Args,
- PerFunctionState &PFS) {
- if (ParseToken(lltok::lsquare, "expected '[' in cleanupblock"))
- return true;
-
- while (Lex.getKind() != lltok::rsquare) {
- // If this isn't the first argument, we need a comma.
- if (!Args.empty() &&
- ParseToken(lltok::comma, "expected ',' in argument list"))
- return true;
-
- // Parse the argument.
- LocTy ArgLoc;
- Type *ArgTy = nullptr;
- if (ParseType(ArgTy, ArgLoc))
- return true;
-
- Value *V;
- if (ArgTy->isMetadataTy()) {
- if (ParseMetadataAsValue(V, PFS))
- return true;
- } else {
- if (ParseValue(ArgTy, V, PFS))
- return true;
- }
- Args.push_back(V);
- }
-
- Lex.Lex(); // Lex the ']'.
- return false;
-}
-
-/// ParseCleanupRet
-/// ::= 'cleanupret' ('void' | TypeAndValue) unwind ('to' 'caller' | TypeAndValue)
-bool LLParser::ParseCleanupRet(Instruction *&Inst, PerFunctionState &PFS) {
- Type *RetTy = nullptr;
- Value *RetVal = nullptr;
- if (ParseType(RetTy, /*AllowVoid=*/true))
- return true;
-
- if (!RetTy->isVoidTy())
- if (ParseValue(RetTy, RetVal, PFS))
- return true;
-
- if (ParseToken(lltok::kw_unwind, "expected 'unwind' in cleanupret"))
- return true;
-
- BasicBlock *UnwindBB = nullptr;
- if (Lex.getKind() == lltok::kw_to) {
- Lex.Lex();
- if (ParseToken(lltok::kw_caller, "expected 'caller' in cleanupret"))
- return true;
- } else {
- if (ParseTypeAndBasicBlock(UnwindBB, PFS)) {
- return true;
- }
- }
-
- Inst = CleanupReturnInst::Create(Context, RetVal, UnwindBB);
- return false;
-}
-
-/// ParseCatchRet
-/// ::= 'catchret' TypeAndValue
-bool LLParser::ParseCatchRet(Instruction *&Inst, PerFunctionState &PFS) {
- BasicBlock *BB;
- if (ParseTypeAndBasicBlock(BB, PFS))
- return true;
-
- Inst = CatchReturnInst::Create(BB);
- return false;
-}
-
-/// ParseCatchBlock
-/// ::= 'catchblock' Type ParamList 'to' TypeAndValue 'unwind' TypeAndValue
-bool LLParser::ParseCatchBlock(Instruction *&Inst, PerFunctionState &PFS) {
- Type *RetType = nullptr;
-
- SmallVector<Value *, 8> Args;
- if (ParseType(RetType, /*AllowVoid=*/true) || ParseExceptionArgs(Args, PFS))
- return true;
-
- BasicBlock *NormalBB, *UnwindBB;
- if (ParseToken(lltok::kw_to, "expected 'to' in catchblock") ||
- ParseTypeAndBasicBlock(NormalBB, PFS) ||
- ParseToken(lltok::kw_unwind, "expected 'unwind' in catchblock") ||
- ParseTypeAndBasicBlock(UnwindBB, PFS))
- return true;
-
- Inst = CatchBlockInst::Create(RetType, NormalBB, UnwindBB, Args);
- return false;
-}
-
-/// ParseTerminateBlock
-/// ::= 'terminateblock' ParamList 'to' TypeAndValue
-bool LLParser::ParseTerminateBlock(Instruction *&Inst, PerFunctionState &PFS) {
- SmallVector<Value *, 8> Args;
- if (ParseExceptionArgs(Args, PFS))
- return true;
-
- if (ParseToken(lltok::kw_unwind, "expected 'unwind' in terminateblock"))
- return true;
-
- BasicBlock *UnwindBB = nullptr;
- if (Lex.getKind() == lltok::kw_to) {
- Lex.Lex();
- if (ParseToken(lltok::kw_caller, "expected 'caller' in terminateblock"))
- return true;
- } else {
- if (ParseTypeAndBasicBlock(UnwindBB, PFS)) {
- return true;
- }
- }
-
- Inst = TerminateBlockInst::Create(Context, UnwindBB, Args);
- return false;
-}
-
-/// ParseCleanupBlock
-/// ::= 'cleanupblock' ParamList
-bool LLParser::ParseCleanupBlock(Instruction *&Inst, PerFunctionState &PFS) {
- Type *RetType = nullptr;
-
- SmallVector<Value *, 8> Args;
- if (ParseType(RetType, /*AllowVoid=*/true) || ParseExceptionArgs(Args, PFS))
- return true;
-
- Inst = CleanupBlockInst::Create(RetType, Args);
- return false;
-}
-
-/// ParseCatchEndBlock
-/// ::= 'catchendblock' unwind ('to' 'caller' | TypeAndValue)
-bool LLParser::ParseCatchEndBlock(Instruction *&Inst, PerFunctionState &PFS) {
- if (ParseToken(lltok::kw_unwind, "expected 'unwind' in catchendblock"))
- return true;
-
- BasicBlock *UnwindBB = nullptr;
- if (Lex.getKind() == lltok::kw_to) {
- Lex.Lex();
- if (Lex.getKind() == lltok::kw_caller) {
- Lex.Lex();
- } else {
- return true;
- }
- } else {
- if (ParseTypeAndBasicBlock(UnwindBB, PFS)) {
- return true;
- }
- }
-
- Inst = CatchEndBlockInst::Create(Context, UnwindBB);
- return false;
-}
-
//===----------------------------------------------------------------------===//
// Binary Operators.
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/AsmParser/LLParser.h b/llvm/lib/AsmParser/LLParser.h
index 2a39b6d364d..6e57b3e0667 100644
--- a/llvm/lib/AsmParser/LLParser.h
+++ b/llvm/lib/AsmParser/LLParser.h
@@ -381,9 +381,6 @@ namespace llvm {
bool IsMustTailCall = false,
bool InVarArgsFunc = false);
- bool ParseExceptionArgs(SmallVectorImpl<Value *> &Args,
- PerFunctionState &PFS);
-
// Constant Parsing.
bool ParseValID(ValID &ID, PerFunctionState *PFS = nullptr);
bool ParseGlobalValue(Type *Ty, Constant *&V);
@@ -444,12 +441,6 @@ namespace llvm {
bool ParseIndirectBr(Instruction *&Inst, PerFunctionState &PFS);
bool ParseInvoke(Instruction *&Inst, PerFunctionState &PFS);
bool ParseResume(Instruction *&Inst, PerFunctionState &PFS);
- bool ParseCleanupRet(Instruction *&Inst, PerFunctionState &PFS);
- bool ParseCatchRet(Instruction *&Inst, PerFunctionState &PFS);
- bool ParseCatchBlock(Instruction *&Inst, PerFunctionState &PFS);
- bool ParseTerminateBlock(Instruction *&Inst, PerFunctionState &PFS);
- bool ParseCleanupBlock(Instruction *&Inst, PerFunctionState &PFS);
- bool ParseCatchEndBlock(Instruction *&Inst, PerFunctionState &PFS);
bool ParseArithmetic(Instruction *&I, PerFunctionState &PFS, unsigned Opc,
unsigned OperandType);
diff --git a/llvm/lib/AsmParser/LLToken.h b/llvm/lib/AsmParser/LLToken.h
index 6e24224978e..2487d120813 100644
--- a/llvm/lib/AsmParser/LLToken.h
+++ b/llvm/lib/AsmParser/LLToken.h
@@ -51,7 +51,6 @@ namespace lltok {
kw_zeroinitializer,
kw_undef, kw_null,
kw_to,
- kw_caller,
kw_tail,
kw_musttail,
kw_target,
@@ -177,8 +176,7 @@ namespace lltok {
kw_landingpad, kw_personality, kw_cleanup, kw_catch, kw_filter,
kw_ret, kw_br, kw_switch, kw_indirectbr, kw_invoke, kw_resume,
- kw_unreachable, kw_cleanupret, kw_catchret, kw_catchblock,
- kw_terminateblock, kw_cleanupblock, kw_catchendblock,
+ kw_unreachable,
kw_alloca, kw_load, kw_store, kw_fence, kw_cmpxchg, kw_atomicrmw,
kw_getelementptr,
OpenPOWER on IntegriCloud