aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprConstant.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-11-17 03:57:28 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-11-17 03:57:28 +0000
commit7b30b1c866deb37fabe2b25684b7d238258d46ad (patch)
treef9f20e00a6b089eb6656225830d3e2b8b8e4fb62 /lib/CodeGen/CGExprConstant.cpp
parentaa432560efb1ff10aec504a68fe909cd9ae7c1a2 (diff)
A few corrections to the expr constant work. Not enabled at the
moment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59435 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r--lib/CodeGen/CGExprConstant.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp
index bfe43c3c87..4ae7d90772 100644
--- a/lib/CodeGen/CGExprConstant.cpp
+++ b/lib/CodeGen/CGExprConstant.cpp
@@ -859,7 +859,7 @@ llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E,
const llvm::Type *Type =
llvm::PointerType::getUnqual(llvm::Type::Int8Ty);
- const llvm::Type *DestType = C->getType();
+ const llvm::Type *DestType = getTypes().ConvertTypeForMem(E->getType());
// FIXME: It's a little ugly that we need to cast to a pointer,
// apply the GEP and then cast back.
@@ -872,7 +872,7 @@ llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E,
return llvm::ConstantExpr::getIntToPtr(Offset,
getTypes().ConvertType(type));
}
- case APValue::Int:
+ case APValue::Int: {
llvm::Constant *C = llvm::ConstantInt::get(V.getInt());
if (C->getType() == llvm::Type::Int1Ty) {
@@ -880,6 +880,7 @@ llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E,
C = llvm::ConstantExpr::getZExt(C, BoolTy);
}
return C;
+ }
case APValue::Float:
return llvm::ConstantFP::get(V.getFloat());
case APValue::ComplexFloat: {