summaryrefslogtreecommitdiffstats
path: root/clang/CodeGen/CGExprConstant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/CodeGen/CGExprConstant.cpp')
-rw-r--r--clang/CodeGen/CGExprConstant.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/CodeGen/CGExprConstant.cpp b/clang/CodeGen/CGExprConstant.cpp
index 30180c17744..e2405b88f37 100644
--- a/clang/CodeGen/CGExprConstant.cpp
+++ b/clang/CodeGen/CGExprConstant.cpp
@@ -37,7 +37,8 @@ public:
llvm::Constant *VisitStmt(Stmt *S) {
CGM.WarnUnsupported(S, "constant expression");
- return llvm::UndefValue::get(CGM.getTypes().ConvertType(cast<Expr>(S)->getType()));
+ QualType T = cast<Expr>(S)->getType();
+ return llvm::UndefValue::get(CGM.getTypes().ConvertType(T));
}
llvm::Constant *VisitParenExpr(ParenExpr *PE) {
@@ -314,8 +315,8 @@ public:
assert(E->getType()->isIntegerType() && "Result type must be an integer!");
- uint32_t ResultWidth = static_cast<uint32_t>(
- CGM.getContext().getTypeSize(E->getType(), SourceLocation()));
+ uint32_t ResultWidth =
+ static_cast<uint32_t>(CGM.getContext().getTypeSize(E->getType()));
return llvm::ConstantInt::get(llvm::APInt(ResultWidth, Val));
}
@@ -504,15 +505,15 @@ public:
llvm::Constant *EmitSizeAlignOf(QualType TypeToSize,
QualType RetType, bool isSizeOf) {
std::pair<uint64_t, unsigned> Info =
- CGM.getContext().getTypeInfo(TypeToSize, SourceLocation());
+ CGM.getContext().getTypeInfo(TypeToSize);
uint64_t Val = isSizeOf ? Info.first : Info.second;
Val /= 8; // Return size in bytes, not bits.
assert(RetType->isIntegerType() && "Result type must be an integer!");
- uint32_t ResultWidth = static_cast<uint32_t>(
- CGM.getContext().getTypeSize(RetType, SourceLocation()));
+ uint32_t ResultWidth =
+ static_cast<uint32_t>(CGM.getContext().getTypeSize(RetType));
return llvm::ConstantInt::get(llvm::APInt(ResultWidth, Val));
}
@@ -616,8 +617,7 @@ llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E,
QualType type = E->getType().getCanonicalType();
if (type->isIntegerType()) {
- llvm::APSInt
- Value(static_cast<uint32_t>(Context.getTypeSize(type, SourceLocation())));
+ llvm::APSInt Value(static_cast<uint32_t>(Context.getTypeSize(type)));
if (E->isIntegerConstantExpr(Value, Context)) {
return llvm::ConstantInt::get(Value);
}
OpenPOWER on IntegriCloud