summaryrefslogtreecommitdiffstats
path: root/clang/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/CodeGen/CGExprScalar.cpp')
-rw-r--r--clang/CodeGen/CGExprScalar.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/CodeGen/CGExprScalar.cpp b/clang/CodeGen/CGExprScalar.cpp
index 52b022b6611..892712a0d4c 100644
--- a/clang/CodeGen/CGExprScalar.cpp
+++ b/clang/CodeGen/CGExprScalar.cpp
@@ -656,16 +656,14 @@ Value *ScalarExprEmitter::EmitSizeAlignOf(QualType TypeToSize,
QualType RetType,bool isSizeOf){
assert(RetType->isIntegerType() && "Result type must be an integer!");
uint32_t ResultWidth =
- static_cast<uint32_t>(CGF.getContext().getTypeSize(RetType,
- SourceLocation()));
+ static_cast<uint32_t>(CGF.getContext().getTypeSize(RetType));
// sizeof(void) and __alignof__(void) = 1 as a gcc extension.
if (TypeToSize->isVoidType())
return llvm::ConstantInt::get(llvm::APInt(ResultWidth, 1));
/// FIXME: This doesn't handle VLAs yet!
- std::pair<uint64_t, unsigned> Info =
- CGF.getContext().getTypeInfo(TypeToSize, SourceLocation());
+ std::pair<uint64_t, unsigned> Info = CGF.getContext().getTypeInfo(TypeToSize);
uint64_t Val = isSizeOf ? Info.first : Info.second;
Val /= 8; // Return size in bytes, not bits.
@@ -696,8 +694,8 @@ Value *ScalarExprEmitter::VisitUnaryOffsetOf(const UnaryOperator *E)
assert(E->getType()->isIntegerType() && "Result type must be an integer!");
- uint32_t ResultWidth = static_cast<uint32_t>(
- CGF.getContext().getTypeSize(E->getType(), SourceLocation()));
+ uint32_t ResultWidth =
+ static_cast<uint32_t>(CGF.getContext().getTypeSize(E->getType()));
return llvm::ConstantInt::get(llvm::APInt(ResultWidth, Val));
}
@@ -852,8 +850,7 @@ Value *ScalarExprEmitter::VisitBinSub(const BinaryOperator *E) {
const QualType LHSType = E->getLHS()->getType().getCanonicalType();
const QualType LHSElementType = cast<PointerType>(LHSType)->getPointeeType();
- uint64_t ElementSize = CGF.getContext().getTypeSize(LHSElementType,
- SourceLocation()) / 8;
+ uint64_t ElementSize = CGF.getContext().getTypeSize(LHSElementType) / 8;
const llvm::Type *ResultType = ConvertType(E->getType());
LHS = Builder.CreatePtrToInt(LHS, ResultType, "sub.ptr.lhs.cast");
OpenPOWER on IntegriCloud