summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Writer/Writer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-04-16 21:16:05 +0000
committerChris Lattner <sabre@nondot.org>2003-04-16 21:16:05 +0000
commit23bf637211035f4d6855117bb690f5762664df93 (patch)
treee235c6178437bd44ece29f0348cf59ffe2c8bda6 /llvm/lib/Bytecode/Writer/Writer.cpp
parentf46a02c88e2c754800239a3fe458fadc44ba1801 (diff)
downloadbcm5719-llvm-23bf637211035f4d6855117bb690f5762664df93.tar.gz
bcm5719-llvm-23bf637211035f4d6855117bb690f5762664df93.zip
Add support to the bytecode reader/writer for the new linkage types
llvm-svn: 5790
Diffstat (limited to 'llvm/lib/Bytecode/Writer/Writer.cpp')
-rw-r--r--llvm/lib/Bytecode/Writer/Writer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp
index 8f4f785c4d2..03a6c4668e9 100644
--- a/llvm/lib/Bytecode/Writer/Writer.cpp
+++ b/llvm/lib/Bytecode/Writer/Writer.cpp
@@ -46,8 +46,8 @@ BytecodeWriter::BytecodeWriter(std::deque<unsigned char> &o, const Module *M)
bool isBigEndian = true;
bool hasLongPointers = true;
- // Output the version identifier... we are currently on bytecode version #1
- unsigned Version = (1 << 4) | isBigEndian | (hasLongPointers << 1);
+ // Output the version identifier... we are currently on bytecode version #2
+ unsigned Version = (2 << 4) | isBigEndian | (hasLongPointers << 1);
output_vbr(Version, Out);
align32(Out);
@@ -154,9 +154,9 @@ void BytecodeWriter::outputModuleInfoBlock(const Module *M) {
int Slot = Table.getValSlot(I->getType());
assert(Slot != -1 && "Module global vars is broken!");
- // Fields: bit0 = isConstant, bit1 = hasInitializer, bit2=InternalLinkage,
- // bit3+ = Slot # for type
- unsigned oSlot = ((unsigned)Slot << 3) | (I->hasInternalLinkage() << 2) |
+ // Fields: bit0 = isConstant, bit1 = hasInitializer, bit2,3=Linkage,
+ // bit4+ = Slot # for type
+ unsigned oSlot = ((unsigned)Slot << 4) | ((unsigned)I->getLinkage() << 2) |
(I->hasInitializer() << 1) | I->isConstant();
output_vbr(oSlot, Out);
@@ -183,7 +183,7 @@ void BytecodeWriter::outputModuleInfoBlock(const Module *M) {
void BytecodeWriter::outputFunction(const Function *F) {
BytecodeBlock FunctionBlock(BytecodeFormat::Function, Out);
- output_vbr((unsigned)F->hasInternalLinkage(), Out);
+ output_vbr((unsigned)F->getLinkage(), Out);
// Only output the constant pool and other goodies if needed...
if (!F->isExternal()) {
OpenPOWER on IntegriCloud