aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
diff options
context:
space:
mode:
authorMicah Villmow <villmow@gmail.com>2012-10-15 16:24:29 +0000
committerMicah Villmow <villmow@gmail.com>2012-10-15 16:24:29 +0000
commit4bb926d91dbd9842c20dbeb0d6abea7dee36e1fa (patch)
tree882e998a0f6267013cf4b5a4e827cc007d11084b /llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
parentef206f19a4be428092b173339df138a3c17e1687 (diff)
downloadllvm-4bb926d91dbd9842c20dbeb0d6abea7dee36e1fa.zip
llvm-4bb926d91dbd9842c20dbeb0d6abea7dee36e1fa.tar.gz
llvm-4bb926d91dbd9842c20dbeb0d6abea7dee36e1fa.tar.bz2
Resubmit the changes to llvm core to update the functions to support different pointer sizes on a per address space basis.
llvm-svn: 165941
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/Execution.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Interpreter/Execution.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
index 5202b09..326bf79 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -1054,7 +1054,8 @@ GenericValue Interpreter::executeIntToPtrInst(Value *SrcVal, Type *DstTy,
GenericValue Dest, Src = getOperandValue(SrcVal, SF);
assert(DstTy->isPointerTy() && "Invalid PtrToInt instruction");
- uint32_t PtrSize = TD.getPointerSizeInBits();
+ unsigned AS = cast<PointerType>(DstTy)->getAddressSpace();
+ uint32_t PtrSize = TD.getPointerSizeInBits(AS);
if (PtrSize != Src.IntVal.getBitWidth())
Src.IntVal = Src.IntVal.zextOrTrunc(PtrSize);