summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
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
commit3d5450d809a553872e3c931b5312352889b8e80c (patch)
tree81643566fe4f9f30b05d09fc2b0be8961f296655 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent39439739cf2bef1489c171166ff2e2b8542ab056 (diff)
downloadbcm5719-llvm-3d5450d809a553872e3c931b5312352889b8e80c.tar.gz
bcm5719-llvm-3d5450d809a553872e3c931b5312352889b8e80c.zip
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.) llvm-svn: 129235
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 8223f76bbbc..235519850f0 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -714,7 +714,8 @@ bool BitcodeReader::ParseValueSymbolTable() {
// Read a record.
Record.clear();
- switch (Stream.ReadRecord(Code, Record)) {
+ unsigned VSTCode = Stream.ReadRecord(Code, Record);
+ switch (VSTCode) {
default: // Default behavior: unknown type.
break;
case bitc::VST_CODE_ENTRY: { // VST_ENTRY: [valueid, namechar x N]
@@ -729,13 +730,17 @@ bool BitcodeReader::ParseValueSymbolTable() {
ValueName.clear();
break;
}
- case bitc::VST_CODE_BBENTRY: {
+ case bitc::VST_CODE_BBENTRY:
+ case bitc::VST_CODE_LPADENTRY: {
if (ConvertToString(Record, 1, ValueName))
return Error("Invalid VST_BBENTRY record");
BasicBlock *BB = getBasicBlock(Record[0]);
if (BB == 0)
return Error("Invalid BB ID in VST_BBENTRY record");
+ if (VSTCode == bitc::VST_CODE_LPADENTRY)
+ BB->setIsLandingPad(true);
+
BB->setName(StringRef(ValueName.data(), ValueName.size()));
ValueName.clear();
break;
OpenPOWER on IntegriCloud