aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Writer/Writer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-18 06:30:21 +0000
committerChris Lattner <sabre@nondot.org>2003-10-18 06:30:21 +0000
commit22482a14be04acd36dd1564ece09caa8a941a93c (patch)
tree3d65bd8c9fb67d83e1b6c31d725304ef3d34e03f /lib/Bytecode/Writer/Writer.cpp
parent3c4a34e8db5057458d7590b85e9819b7b4c4a7b8 (diff)
add support for new linkage types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Writer/Writer.cpp')
-rw-r--r--lib/Bytecode/Writer/Writer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp
index 0968461456..5cc3eec872 100644
--- a/lib/Bytecode/Writer/Writer.cpp
+++ b/lib/Bytecode/Writer/Writer.cpp
@@ -162,10 +162,10 @@ static unsigned getEncodedLinkage(const GlobalValue *GV) {
switch (GV->getLinkage()) {
default: assert(0 && "Invalid linkage!");
case GlobalValue::ExternalLinkage: return 0;
- case GlobalValue::LinkOnceLinkage: return 1;
case GlobalValue::WeakLinkage: return 1;
case GlobalValue::AppendingLinkage: return 2;
case GlobalValue::InternalLinkage: return 3;
+ case GlobalValue::LinkOnceLinkage: return 4;
}
}
@@ -177,9 +177,9 @@ void BytecodeWriter::outputModuleInfoBlock(const Module *M) {
int Slot = Table.getSlot(I->getType());
assert(Slot != -1 && "Module global vars is broken!");
- // Fields: bit0 = isConstant, bit1 = hasInitializer, bit2,3=Linkage,
- // bit4+ = Slot # for type
- unsigned oSlot = ((unsigned)Slot << 4) | (getEncodedLinkage(I) << 2) |
+ // Fields: bit0 = isConstant, bit1 = hasInitializer, bit2-4=Linkage,
+ // bit5+ = Slot # for type
+ unsigned oSlot = ((unsigned)Slot << 5) | (getEncodedLinkage(I) << 2) |
(I->hasInitializer() << 1) | I->isConstant();
output_vbr(oSlot, Out);