summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-03 22:18:21 +0000
committerChris Lattner <sabre@nondot.org>2007-05-03 22:18:21 +0000
commit6be58c65d4f7408b183e4267cdc82662df5269c6 (patch)
treea945eb31028513467135a60232684057e26cc65a /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent5a800309afeee25bdb7d31230c210989e0a1a24d (diff)
downloadbcm5719-llvm-6be58c65d4f7408b183e4267cdc82662df5269c6.tar.gz
bcm5719-llvm-6be58c65d4f7408b183e4267cdc82662df5269c6.zip
fix encoding of BB names in the symtab
llvm-svn: 36704
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index fbad7ff1255..68f0a0d1637 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -669,7 +669,6 @@ static void WriteInstruction(const Instruction &I, ValueEnumerator &VE,
}
break;
}
-
case Instruction::VAArg:
Code = bitc::FUNC_CODE_INST_VAARG;
Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); // valistty
@@ -697,16 +696,23 @@ static void WriteValueSymbolTable(const ValueSymbolTable &VST,
SI != SE; ++SI) {
unsigned AbbrevToUse = 0;
- // VST_ENTRY: [valueid, namelen, namechar x N]
- NameVals.push_back(VE.getValueID(SI->getValue()));
+ // VST_ENTRY: [valueid, namelen, namechar x N]
+ // VST_BBENTRY: [bbid, namelen, namechar x N]
+ unsigned Code;
+ if (isa<BasicBlock>(SI->getValue())) {
+ Code = bitc::VST_CODE_BBENTRY;
+ } else {
+ Code = bitc::VST_CODE_ENTRY;
+ }
+ NameVals.push_back(VE.getValueID(SI->getValue()));
NameVals.push_back(SI->getKeyLength());
for (const char *P = SI->getKeyData(),
*E = SI->getKeyData()+SI->getKeyLength(); P != E; ++P)
NameVals.push_back((unsigned char)*P);
// Emit the finished record.
- Stream.EmitRecord(bitc::VST_CODE_ENTRY, NameVals, AbbrevToUse);
+ Stream.EmitRecord(Code, NameVals, AbbrevToUse);
NameVals.clear();
}
Stream.ExitBlock();
OpenPOWER on IntegriCloud