aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprConstant.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-10-13 10:07:13 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2009-10-13 10:07:13 +0000
commit3c0ef8cc0dc246bd3083e8cdd63005e8873d36d2 (patch)
tree58cf4d4581c365f1dcf6a6d99ec91d1c3066504d /lib/CodeGen/CGExprConstant.cpp
parent3ae9f48ae0d07a5aa352bf03c944f557a5ac4c95 (diff)
Simplify pointer creation with the new Type::getInt*Ptr methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83964 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r--lib/CodeGen/CGExprConstant.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp
index 9621e2a21c..119b6f31e4 100644
--- a/lib/CodeGen/CGExprConstant.cpp
+++ b/lib/CodeGen/CGExprConstant.cpp
@@ -826,8 +826,7 @@ llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E,
// Apply offset if necessary.
if (!Offset->isNullValue()) {
- const llvm::Type *Type =
- llvm::PointerType::getUnqual(llvm::Type::getInt8Ty(VMContext));
+ const llvm::Type *Type = llvm::Type::getInt8PtrTy(VMContext);
llvm::Constant *Casted = llvm::ConstantExpr::getBitCast(C, Type);
Casted = llvm::ConstantExpr::getGetElementPtr(Casted, &Offset, 1);
C = llvm::ConstantExpr::getBitCast(Casted, C->getType());