diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2008-11-17 03:57:28 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2008-11-17 03:57:28 +0000 |
| commit | dcbcbb827d402670ccb6d1a01e9cb98c98137f27 (patch) | |
| tree | 66f4df51d9996b079066e48d7a2a2bd55a369671 /clang/lib/CodeGen | |
| parent | a5055a03c6fc6d17bb27bbbe0beb71b05b1568a4 (diff) | |
| download | bcm5719-llvm-dcbcbb827d402670ccb6d1a01e9cb98c98137f27.tar.gz bcm5719-llvm-dcbcbb827d402670ccb6d1a01e9cb98c98137f27.zip | |
A few corrections to the expr constant work. Not enabled at the
moment.
llvm-svn: 59435
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGExprConstant.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp index bfe43c3c87c..4ae7d907720 100644 --- a/clang/lib/CodeGen/CGExprConstant.cpp +++ b/clang/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: { |

