[llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Feb 8 20:46:17 PST 2006
Changes in directory llvm/lib/ExecutionEngine/JIT:
JITEmitter.cpp updated: 1.80 -> 1.81
---
Log message:
Adjust to MachineConstantPool interface change: instead of keeping a
value/alignment pair for each constant, keep a value/offset pair.
---
Diffs of the changes: (+10 -7)
JITEmitter.cpp | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
Index: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
diff -u llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.80 llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.81
--- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.80 Wed Feb 8 22:22:52 2006
+++ llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Wed Feb 8 22:46:04 2006
@@ -569,14 +569,17 @@
const std::vector<MachineConstantPoolEntry> &Constants = MCP->getConstants();
if (Constants.empty()) return;
+ unsigned Size = Constants.back().Offset;
+ Size += TheJIT->getTargetData().getTypeSize(Constants.back().Val->getType());
+
+ void *Addr = MemMgr.allocateConstant(Size,
+ 1 << MCP->getConstantPoolAlignment());
+
+ // FIXME: Can eliminate ConstantPoolAddresses!
for (unsigned i = 0, e = Constants.size(); i != e; ++i) {
- const Type *Ty = Constants[i].Val->getType();
- unsigned Size = (unsigned)TheJIT->getTargetData().getTypeSize(Ty);
- unsigned Alignment = Constants[i].Alignment;
-
- void *Addr = MemMgr.allocateConstant(Size, Alignment);
- TheJIT->InitializeMemory(Constants[i].Val, Addr);
- ConstantPoolAddresses.push_back(Addr);
+ void *CAddr = (char*)Addr+Constants[i].Offset;
+ TheJIT->InitializeMemory(Constants[i].Val, CAddr);
+ ConstantPoolAddresses.push_back(CAddr);
}
}
More information about the llvm-commits
mailing list