summaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-09-12 20:59:59 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-09-12 20:59:59 +0000
commitcd5731d98b15c9de236bd0dd6c9c57d9bcecbceb (patch)
tree4011bad2202639468d99a937a64bd30d0f73f7ee /lib/ExecutionEngine
parent9a7746d7841b12480d1308c69ef9e6a4f916a154 (diff)
downloadexternal_llvm-cd5731d98b15c9de236bd0dd6c9c57d9bcecbceb.zip
external_llvm-cd5731d98b15c9de236bd0dd6c9c57d9bcecbceb.tar.gz
external_llvm-cd5731d98b15c9de236bd0dd6c9c57d9bcecbceb.tar.bz2
Reflect MachineConstantPoolEntry changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30277 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/JIT/JITEmitter.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp
index 91ae641..0fe82fd 100644
--- a/lib/ExecutionEngine/JIT/JITEmitter.cpp
+++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp
@@ -861,8 +861,11 @@ void JITEmitter::emitConstantPool(MachineConstantPool *MCP) {
const std::vector<MachineConstantPoolEntry> &Constants = MCP->getConstants();
if (Constants.empty()) return;
- unsigned Size = Constants.back().Offset;
- Size += TheJIT->getTargetData()->getTypeSize(Constants.back().Val->getType());
+ MachineConstantPoolEntry CPE = Constants.back();
+ unsigned Size = CPE.Offset;
+ const Type *Ty = CPE.isMachineConstantPoolEntry()
+ ? CPE.Val.ConstVal->getType() : CPE.Val.MachineCPVal->getType();
+ Size += TheJIT->getTargetData()->getTypeSize(Ty);
ConstantPoolBase = allocateSpace(Size, 1 << MCP->getConstantPoolAlignment());
ConstantPool = MCP;
@@ -872,7 +875,13 @@ void JITEmitter::emitConstantPool(MachineConstantPool *MCP) {
// Initialize the memory for all of the constant pool entries.
for (unsigned i = 0, e = Constants.size(); i != e; ++i) {
void *CAddr = (char*)ConstantPoolBase+Constants[i].Offset;
- TheJIT->InitializeMemory(Constants[i].Val, CAddr);
+ if (Constants[i].isMachineConstantPoolEntry()) {
+ // FIXME: add support to lower machine constant pool values into bytes!
+ std::cerr << "Initialize memory with machine specific constant pool entry"
+ << " has not been implemented!\n";
+ abort();
+ }
+ TheJIT->InitializeMemory(Constants[i].Val.ConstVal, CAddr);
}
}