[llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Apr 16 16:17:04 PDT 2003
Changes in directory llvm/lib/Bytecode/Writer:
Writer.cpp updated: 1.31 -> 1.32
---
Log message:
Add support to the bytecode reader/writer for the new linkage types
---
Diffs of the changes:
Index: llvm/lib/Bytecode/Writer/Writer.cpp
diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.31 llvm/lib/Bytecode/Writer/Writer.cpp:1.32
--- llvm/lib/Bytecode/Writer/Writer.cpp:1.31 Wed Mar 19 14:56:46 2003
+++ llvm/lib/Bytecode/Writer/Writer.cpp Wed Apr 16 16:16:05 2003
@@ -46,8 +46,8 @@
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 @@
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::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()) {
More information about the llvm-commits
mailing list