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
This commit is contained in:
Bill Wendling
2011-04-10 23:18:04 +00:00
parent c6cf197315
commit 5d7a5a4f53
10 changed files with 16 additions and 87 deletions

View File

@ -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;

View File

@ -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();