summaryrefslogtreecommitdiff
path: root/lib/AsmParser
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-04-10 00:04:27 +0000
committerBill Wendling <isanbard@gmail.com>2011-04-10 00:04:27 +0000
commitd7bb295d223e028aa9ba7fbeafc8928db4a74972 (patch)
tree6bbe67645fc6f7c4500dc6df7b7966e203ffda3f /lib/AsmParser
parentb1145c8cee6ab749f00d07d3d7dab0d1d1fd0c06 (diff)
downloadllvm-d7bb295d223e028aa9ba7fbeafc8928db4a74972.tar.gz
llvm-d7bb295d223e028aa9ba7fbeafc8928db4a74972.tar.bz2
llvm-d7bb295d223e028aa9ba7fbeafc8928db4a74972.tar.xz
Beginning of the Great Exception Handling Rewrite.
* Add a "landing pad" attribute to the BasicBlock. * Modify the bitcode reader and writer to handle said attribute. Later: The verifier will ensure that the landing pad attribute is used in the appropriate manner. I.e., not applied to the entry block, and applied only to basic blocks that are branched to via a `dispatch' instruction. (This is a work-in-progress.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129235 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser')
-rw-r--r--lib/AsmParser/LLLexer.cpp2
-rw-r--r--lib/AsmParser/LLParser.cpp5
-rw-r--r--lib/AsmParser/LLToken.h3
3 files changed, 10 insertions, 0 deletions
diff --git a/lib/AsmParser/LLLexer.cpp b/lib/AsmParser/LLLexer.cpp
index 857fa1ef62..da26cb8210 100644
--- a/lib/AsmParser/LLLexer.cpp
+++ b/lib/AsmParser/LLLexer.cpp
@@ -587,6 +587,8 @@ lltok::Kind LLLexer::LexIdentifier() {
KEYWORD(x);
KEYWORD(blockaddress);
+
+ KEYWORD(landingpad);
#undef KEYWORD
// Keywords for types.
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index 0c3237a679..afd10a0826 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/lib/AsmParser/LLParser.cpp
@@ -2918,6 +2918,11 @@ bool LLParser::ParseBasicBlock(PerFunctionState &PFS) {
BasicBlock *BB = PFS.DefineBB(Name, NameLoc);
if (BB == 0) return true;
+ if (Lex.getKind() == lltok::kw_landingpad) {
+ BB->setIsLandingPad();
+ Lex.Lex();
+ }
+
std::string NameStr;
// Parse the instructions in this block until we get a terminator.
diff --git a/lib/AsmParser/LLToken.h b/lib/AsmParser/LLToken.h
index 576da191ae..53cf8d87f3 100644
--- a/lib/AsmParser/LLToken.h
+++ b/lib/AsmParser/LLToken.h
@@ -125,6 +125,9 @@ namespace lltok {
kw_extractelement, kw_insertelement, kw_shufflevector, kw_getresult,
kw_extractvalue, kw_insertvalue, kw_blockaddress,
+ // Basic block attribute.
+ kw_landingpad,
+
// Unsigned Valued tokens (UIntVal).
GlobalID, // @42
LocalVarID, // %42