[llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat Oct 18 01:31:20 PDT 2003


Changes in directory llvm/lib/Bytecode/Writer:

Writer.cpp updated: 1.42 -> 1.43

---
Log message:

add support for new linkage types


---
Diffs of the changes:  (+4 -4)

Index: llvm/lib/Bytecode/Writer/Writer.cpp
diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.42 llvm/lib/Bytecode/Writer/Writer.cpp:1.43
--- llvm/lib/Bytecode/Writer/Writer.cpp:1.42	Sat Oct 18 00:54:48 2003
+++ llvm/lib/Bytecode/Writer/Writer.cpp	Sat Oct 18 01:30:21 2003
@@ -162,10 +162,10 @@
   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 @@
     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);
 





More information about the llvm-commits mailing list