diff options
author | Chris Lattner <sabre@nondot.org> | 2003-10-18 06:30:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-10-18 06:30:21 +0000 |
commit | dc83293a38be16a89ce7f528859b45633757975b (patch) | |
tree | cc5afcd209431fe0779efa8c83c78d4a523aa2e3 /llvm/lib/Bytecode/Writer/Writer.cpp | |
parent | b32f5748b70ed30d61b83f1486d8e3d48011f678 (diff) | |
download | bcm5719-llvm-dc83293a38be16a89ce7f528859b45633757975b.tar.gz bcm5719-llvm-dc83293a38be16a89ce7f528859b45633757975b.zip |
add support for new linkage types
llvm-svn: 9228
Diffstat (limited to 'llvm/lib/Bytecode/Writer/Writer.cpp')
-rw-r--r-- | llvm/lib/Bytecode/Writer/Writer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp index 09684614567..5cc3eec8722 100644 --- a/llvm/lib/Bytecode/Writer/Writer.cpp +++ b/llvm/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); |