aboutsummaryrefslogtreecommitdiff
path: root/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-07-13 03:25:53 +0000
committerChris Lattner <sabre@nondot.org>2007-07-13 03:25:53 +0000
commitfa7c64562d0bf0c9014f0b733a9eaad139c72484 (patch)
treeef574a51b7ad23cfa8264795b8bf9084a9c94a19 /CodeGen
parent8b9023ba35a86838789e2c9034a6128728c547aa (diff)
"Someone typed "PtrToInt" where they meant "IntToPtr".
I've added a tests/CodeGen directory, and a test for this case that used to fail and now passes." Patch by Keith Bauer git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen')
-rw-r--r--CodeGen/CGExpr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/CodeGen/CGExpr.cpp b/CodeGen/CGExpr.cpp
index 51ad770dca..ff55e96086 100644
--- a/CodeGen/CGExpr.cpp
+++ b/CodeGen/CGExpr.cpp
@@ -97,7 +97,7 @@ RValue CodeGenFunction::EmitConversion(RValue Val, QualType ValTy,
if (isa<llvm::PointerType>(Val.getVal()->getType()))
return RValue::get(Builder.CreateBitCast(Val.getVal(), DestTy, "conv"));
assert(ValTy->isIntegerType() && "Not ptr->ptr or int->ptr conversion?");
- return RValue::get(Builder.CreatePtrToInt(Val.getVal(), DestTy, "conv"));
+ return RValue::get(Builder.CreateIntToPtr(Val.getVal(), DestTy, "conv"));
}
if (isa<PointerType>(ValTy)) {