diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2006-09-12 20:59:59 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2006-09-12 20:59:59 +0000 |
| commit | 3228e750be1a13cd37fe00ae7c4a746b19ed7230 (patch) | |
| tree | 47902cd6f8a48dbfdcc8bcefde195443d050aa9f /llvm/lib/ExecutionEngine | |
| parent | 1d1835b4ed2787ec1c42c3fb41368c341a3d8fb9 (diff) | |
| download | bcm5719-llvm-3228e750be1a13cd37fe00ae7c4a746b19ed7230.tar.gz bcm5719-llvm-3228e750be1a13cd37fe00ae7c4a746b19ed7230.zip | |
Reflect MachineConstantPoolEntry changes.
llvm-svn: 30277
Diffstat (limited to 'llvm/lib/ExecutionEngine')
| -rw-r--r-- | llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp index 91ae641c2e6..0fe82fd6c84 100644 --- a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/llvm/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); } } |

