summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorMicah Villmow <villmow@gmail.com>2012-10-24 15:52:52 +0000
committerMicah Villmow <villmow@gmail.com>2012-10-24 15:52:52 +0000
commitaa76e9e2cf50af190de90bc778b7f7e42ef9ceff (patch)
tree5206b0fb0ac695e3ab1c9cf434b5a85195abf336 /lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parent3575222175b4982f380ff291bb17be67aadc0966 (diff)
downloadllvm-aa76e9e2cf50af190de90bc778b7f7e42ef9ceff.tar.gz
llvm-aa76e9e2cf50af190de90bc778b7f7e42ef9ceff.tar.bz2
llvm-aa76e9e2cf50af190de90bc778b7f7e42ef9ceff.tar.xz
Add in support for getIntPtrType to get the pointer type based on the address space.
This checkin also adds in some tests that utilize these paths and updates some of the clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166578 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 4de98da655..faadc0fa66 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1505,7 +1505,7 @@ static const MCExpr *lowerConstant(const Constant *CV, AsmPrinter &AP) {
// Handle casts to pointers by changing them into casts to the appropriate
// integer type. This promotes constant folding and simplifies this code.
Constant *Op = CE->getOperand(0);
- Op = ConstantExpr::getIntegerCast(Op, TD.getIntPtrType(CV->getContext()),
+ Op = ConstantExpr::getIntegerCast(Op, TD.getIntPtrType(CE->getType()),
false/*ZExt*/);
return lowerConstant(Op, AP);
}