diff options
author | Derek Schuff <dschuff@chromium.org> | 2012-10-25 11:26:14 -0700 |
---|---|---|
committer | Derek Schuff <dschuff@chromium.org> | 2012-10-25 11:26:14 -0700 |
commit | 5c897cf45a7b9df227e0c562c27454f56ba86c20 (patch) | |
tree | ae3a9ea4d11bfb20379639dd9ca0951ce411e73a /lib/ExecutionEngine/ExecutionEngine.cpp | |
parent | 89758b0545198f9a3876f0deb747146cbd84ce61 (diff) | |
parent | a8a0a155de16830b8fcab539ba2ec21de3145532 (diff) |
Merge commit 'a8a0a155de16830b8fcab539ba2ec21de3145532'
Conflicts:
lib/Target/X86/X86FrameLowering.cpp
lib/Target/X86/X86ISelLowering.cpp
The Intel folks switched some of the FrameLowering code to use
X86RegisterInfo::getSlotSize isntead of pointer size, thus reducing
our localmods in that file.
Diffstat (limited to 'lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r-- | lib/ExecutionEngine/ExecutionEngine.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index 94a2542e7a..99f6ec691a 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -645,16 +645,17 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) { } case Instruction::PtrToInt: { GenericValue GV = getConstantValue(Op0); - unsigned AS = cast<PointerType>(CE->getOperand(1)->getType()) - ->getAddressSpace(); - uint32_t PtrWidth = TD->getPointerSizeInBits(AS); + assert(CE->getOperand(1)->getType()->isPointerTy() && + "Must be a pointer type!"); + uint32_t PtrWidth = TD->getTypeSizeInBits(CE->getOperand(1)->getType()); GV.IntVal = APInt(PtrWidth, uintptr_t(GV.PointerVal)); return GV; } case Instruction::IntToPtr: { GenericValue GV = getConstantValue(Op0); - unsigned AS = cast<PointerType>(CE->getType())->getAddressSpace(); - uint32_t PtrWidth = TD->getPointerSizeInBits(AS); + assert(CE->getOperand(1)->getType()->isPointerTy() && + "Must be a pointer type!"); + uint32_t PtrWidth = TD->getTypeSizeInBits(CE->getType()); if (PtrWidth != GV.IntVal.getBitWidth()) GV.IntVal = GV.IntVal.zextOrTrunc(PtrWidth); assert(GV.IntVal.getBitWidth() <= 64 && "Bad pointer width"); |