[llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat Nov 5 14:08:26 PST 2005
Changes in directory llvm/lib/Bytecode/Writer:
Writer.cpp updated: 1.108 -> 1.109
---
Log message:
Write/read allocation instruction alignment info to .bc files.
---
Diffs of the changes: (+7 -0)
Writer.cpp | 7 +++++++
1 files changed, 7 insertions(+)
Index: llvm/lib/Bytecode/Writer/Writer.cpp
diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.108 llvm/lib/Bytecode/Writer/Writer.cpp:1.109
--- llvm/lib/Bytecode/Writer/Writer.cpp:1.108 Wed Aug 17 14:23:14 2005
+++ llvm/lib/Bytecode/Writer/Writer.cpp Sat Nov 5 16:08:14 2005
@@ -693,6 +693,13 @@
assert(Slots[1] != ~0U && "Cast return type unknown?");
if (Slots[1] > MaxOpSlot) MaxOpSlot = Slots[1];
NumOperands++;
+ } else if (const AllocationInst *AI = dyn_cast<AllocationInst>(&I)) {
+ assert(NumOperands == 1 && "Bogus allocation!");
+ if (AI->getAlignment()) {
+ Slots[1] = Log2_32(AI->getAlignment())+1;
+ if (Slots[1] > MaxOpSlot) MaxOpSlot = Slots[1];
+ NumOperands = 2;
+ }
} else if (const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(&I)) {
// We need to encode the type of sequential type indices into their slot #
unsigned Idx = 1;
More information about the llvm-commits
mailing list