[llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
Evan Cheng
evan.cheng at apple.com
Tue Jan 31 14:21:50 PST 2006
Changes in directory llvm/lib/ExecutionEngine/JIT:
JITEmitter.cpp updated: 1.78 -> 1.79
---
Log message:
Allow the specification of explicit alignments for constant pool entries.
---
Diffs of the changes: (+6 -4)
JITEmitter.cpp | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
Index: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
diff -u llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.78 llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.79
--- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.78 Sun Jan 22 17:41:42 2006
+++ llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Tue Jan 31 16:21:33 2006
@@ -566,16 +566,18 @@
}
void JITEmitter::emitConstantPool(MachineConstantPool *MCP) {
- const std::vector<Constant*> &Constants = MCP->getConstants();
+ const std::vector<std::pair<Constant*,unsigned> > &Constants = MCP->getConstants();
if (Constants.empty()) return;
for (unsigned i = 0, e = Constants.size(); i != e; ++i) {
- const Type *Ty = Constants[i]->getType();
+ const Type *Ty = Constants[i].first->getType();
unsigned Size = (unsigned)TheJIT->getTargetData().getTypeSize(Ty);
- unsigned Alignment = TheJIT->getTargetData().getTypeAlignment(Ty);
+ unsigned Alignment = (Constants[i].second == 0)
+ ? TheJIT->getTargetData().getTypeAlignment(Ty)
+ : Constants[i].second;
void *Addr = MemMgr.allocateConstant(Size, Alignment);
- TheJIT->InitializeMemory(Constants[i], Addr);
+ TheJIT->InitializeMemory(Constants[i].first, Addr);
ConstantPoolAddresses.push_back(Addr);
}
}
More information about the llvm-commits
mailing list