diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-04-10 23:18:04 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-04-10 23:18:04 +0000 |
commit | 5d7a5a4f53304869ae5b76771ab67213447b65a5 (patch) | |
tree | 7a3b9ece646fc6ee260ab1467a1e693d9128b5a1 | |
parent | c6cf19731504e7f922d1409ac118c59f5ab8e3c2 (diff) |
Revert r129235 pending a vetting of the EH rewrite.
--- Reverse-merging r129235 into '.':
D test/Feature/bb_attrs.ll
U include/llvm/BasicBlock.h
U include/llvm/Bitcode/LLVMBitCodes.h
U lib/VMCore/AsmWriter.cpp
U lib/VMCore/BasicBlock.cpp
U lib/AsmParser/LLParser.cpp
U lib/AsmParser/LLLexer.cpp
U lib/AsmParser/LLToken.h
U lib/Bitcode/Reader/BitcodeReader.cpp
U lib/Bitcode/Writer/BitcodeWriter.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129259 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/BasicBlock.h | 6 | ||||
-rw-r--r-- | include/llvm/Bitcode/LLVMBitCodes.h | 5 | ||||
-rw-r--r-- | lib/AsmParser/LLLexer.cpp | 2 | ||||
-rw-r--r-- | lib/AsmParser/LLParser.cpp | 5 | ||||
-rw-r--r-- | lib/AsmParser/LLToken.h | 3 | ||||
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 9 | ||||
-rw-r--r-- | lib/Bitcode/Writer/BitcodeWriter.cpp | 32 | ||||
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 7 | ||||
-rw-r--r-- | lib/VMCore/BasicBlock.cpp | 5 | ||||
-rw-r--r-- | test/Feature/bb_attrs.ll | 29 |
10 files changed, 16 insertions, 87 deletions
diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h index 3336b3610d..7e7c9e7694 100644 --- a/include/llvm/BasicBlock.h +++ b/include/llvm/BasicBlock.h @@ -74,7 +74,6 @@ public: private: InstListType InstList; Function *Parent; - bool IsLandingPad; void setParent(Function *parent); friend class SymbolTableListTraits<BasicBlock, Function>; @@ -139,11 +138,6 @@ public: return const_cast<BasicBlock*>(this)->getFirstNonPHIOrDbg(); } - /// isLandingPad - True if this basic block is a landing pad for exception - /// handling. - bool isLandingPad() const { return IsLandingPad; } - void setIsLandingPad(bool Val = true) { IsLandingPad = Val; } - /// removeFromParent - This method unlinks 'this' from the containing /// function, but does not delete it. /// diff --git a/include/llvm/Bitcode/LLVMBitCodes.h b/include/llvm/Bitcode/LLVMBitCodes.h index dcfbe5a6b4..7692bd2872 100644 --- a/include/llvm/Bitcode/LLVMBitCodes.h +++ b/include/llvm/Bitcode/LLVMBitCodes.h @@ -106,9 +106,8 @@ namespace bitc { // The value symbol table only has one code (VST_ENTRY_CODE). enum ValueSymtabCodes { - VST_CODE_ENTRY = 1, // VST_ENTRY: [valid, namechar x N] - VST_CODE_BBENTRY = 2, // VST_BBENTRY: [bbid, namechar x N] - VST_CODE_LPADENTRY = 3 // VST_LPADENTRY: [lpadid, namechar x N] + VST_CODE_ENTRY = 1, // VST_ENTRY: [valid, namechar x N] + VST_CODE_BBENTRY = 2 // VST_BBENTRY: [bbid, namechar x N] }; enum MetadataCodes { diff --git a/lib/AsmParser/LLLexer.cpp b/lib/AsmParser/LLLexer.cpp index da26cb8210..857fa1ef62 100644 --- a/lib/AsmParser/LLLexer.cpp +++ b/lib/AsmParser/LLLexer.cpp @@ -587,8 +587,6 @@ 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 afd10a0826..0c3237a679 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -2918,11 +2918,6 @@ 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 53cf8d87f3..576da191ae 100644 --- a/lib/AsmParser/LLToken.h +++ b/lib/AsmParser/LLToken.h @@ -125,9 +125,6 @@ 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 diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 235519850f..8223f76bbb 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -714,8 +714,7 @@ bool BitcodeReader::ParseValueSymbolTable() { // Read a record. Record.clear(); - unsigned VSTCode = Stream.ReadRecord(Code, Record); - switch (VSTCode) { + switch (Stream.ReadRecord(Code, Record)) { default: // Default behavior: unknown type. break; case bitc::VST_CODE_ENTRY: { // VST_ENTRY: [valueid, namechar x N] @@ -730,17 +729,13 @@ bool BitcodeReader::ParseValueSymbolTable() { ValueName.clear(); break; } - case bitc::VST_CODE_BBENTRY: - case bitc::VST_CODE_LPADENTRY: { + case bitc::VST_CODE_BBENTRY: { 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; diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index 51c13bd501..e34137f615 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -40,7 +40,6 @@ enum { VST_ENTRY_7_ABBREV, VST_ENTRY_6_ABBREV, VST_BBENTRY_6_ABBREV, - VST_LPADENTRY_6_ABBREV, // CONSTANTS_BLOCK abbrev id's. CONSTANTS_SETTYPE_ABBREV = bitc::FIRST_APPLICATION_ABBREV, @@ -1180,20 +1179,13 @@ static void WriteValueSymbolTable(const ValueSymbolTable &VST, unsigned AbbrevToUse = VST_ENTRY_8_ABBREV; - // VST_ENTRY: [valueid, namechar x N] - // VST_BBENTRY: [bbid, namechar x N] - // VST_LPADENTRY: [lpadid, namechar x N] + // VST_ENTRY: [valueid, namechar x N] + // VST_BBENTRY: [bbid, namechar x N] unsigned Code; - if (const BasicBlock *BB = dyn_cast<BasicBlock>(SI->getValue())) { - if (BB->isLandingPad()) { - Code = bitc::VST_CODE_LPADENTRY; - if (isChar6) - AbbrevToUse = VST_LPADENTRY_6_ABBREV; - } else { - Code = bitc::VST_CODE_BBENTRY; - if (isChar6) - AbbrevToUse = VST_BBENTRY_6_ABBREV; - } + if (isa<BasicBlock>(SI->getValue())) { + Code = bitc::VST_CODE_BBENTRY; + if (isChar6) + AbbrevToUse = VST_BBENTRY_6_ABBREV; } else { Code = bitc::VST_CODE_ENTRY; if (isChar6) @@ -1374,16 +1366,8 @@ static void WriteBlockInfo(const ValueEnumerator &VE, BitstreamWriter &Stream) { Abbv) != VST_BBENTRY_6_ABBREV) llvm_unreachable("Unexpected abbrev ordering!"); } - { // 6-bit char6 VST_LPADENTRY strings. - BitCodeAbbrev *Abbv = new BitCodeAbbrev(); - Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_LPADENTRY)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Char6)); - if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID, - Abbv) != VST_LPADENTRY_6_ABBREV) - llvm_unreachable("Unexpected abbrev ordering!"); - } + + { // SETTYPE abbrev for CONSTANTS_BLOCK. BitCodeAbbrev *Abbv = new BitCodeAbbrev(); diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index a92c9bc668..ffd367a7ad 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -1687,13 +1687,8 @@ void AssemblyWriter::printBasicBlock(const BasicBlock *BB) { Out << "\n"; PrintLLVMName(Out, BB->getName(), LabelPrefix); Out << ':'; - if (BB->isLandingPad()) - Out << " landingpad"; } else if (!BB->use_empty()) { // Don't print block # of no uses... - Out << '\n'; - if (BB->isLandingPad()) - Out << "landingpad "; - Out << "; <label>:"; + Out << "\n; <label>:"; int Slot = Machine.getLocalSlot(BB); if (Slot != -1) Out << Slot; diff --git a/lib/VMCore/BasicBlock.cpp b/lib/VMCore/BasicBlock.cpp index b46fab590f..955a0285b2 100644 --- a/lib/VMCore/BasicBlock.cpp +++ b/lib/VMCore/BasicBlock.cpp @@ -38,10 +38,10 @@ LLVMContext &BasicBlock::getContext() const { // are not in the public header file... template class llvm::SymbolTableListTraits<Instruction, BasicBlock>; + BasicBlock::BasicBlock(LLVMContext &C, const Twine &Name, Function *NewParent, BasicBlock *InsertBefore) - : Value(Type::getLabelTy(C), Value::BasicBlockVal), Parent(0), - IsLandingPad(false) { + : Value(Type::getLabelTy(C), Value::BasicBlockVal), Parent(0) { // Make sure that we get added to a function LeakDetector::addGarbageObject(this); @@ -57,6 +57,7 @@ BasicBlock::BasicBlock(LLVMContext &C, const Twine &Name, Function *NewParent, setName(Name); } + BasicBlock::~BasicBlock() { // If the address of the block is taken and it is being deleted (e.g. because // it is dead), this means that there is either a dangling constant expr diff --git a/test/Feature/bb_attrs.ll b/test/Feature/bb_attrs.ll deleted file mode 100644 index af2af31d69..0000000000 --- a/test/Feature/bb_attrs.ll +++ /dev/null @@ -1,29 +0,0 @@ -; RUN: llvm-as < %s | llvm-dis > %t1.ll -; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll -; RUN: diff %t1.ll %t2.ll - -; Test for basic block attributes. - -define i32 @f1(i32 %a) { -entry: - %cmp = icmp slt i32 %a, 37 - br i1 %cmp, label %bb, label %lpad - -bb: - ret i32 37 - -lpad: landingpad - ret i32 927 -} - -define i32 @f2(i32 %a) { -; entry : 0 - %1 = icmp slt i32 %a, 37 - br i1 %1, label %2, label %3 - -; bb : 2 - ret i32 37 - -landingpad ; bb : 3 - ret i32 927 -} |