remove the source location arguments to various target query methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47954 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CGExprAgg.cpp b/CodeGen/CGExprAgg.cpp
index 493d279..325ac21 100644
--- a/CodeGen/CGExprAgg.cpp
+++ b/CodeGen/CGExprAgg.cpp
@@ -103,8 +103,7 @@
DestPtr = Builder.CreateBitCast(DestPtr, BP, "tmp");
// Get size and alignment info for this aggregate.
- std::pair<uint64_t, unsigned> TypeInfo =
- CGF.getContext().getTypeInfo(Ty, SourceLocation());
+ std::pair<uint64_t, unsigned> TypeInfo = CGF.getContext().getTypeInfo(Ty);
// FIXME: Handle variable sized types.
const llvm::Type *IntPtr = llvm::IntegerType::get(CGF.LLVMPointerWidth);
@@ -132,8 +131,7 @@
SrcPtr = Builder.CreateBitCast(SrcPtr, BP, "tmp");
// Get size and alignment info for this aggregate.
- std::pair<uint64_t, unsigned> TypeInfo =
- CGF.getContext().getTypeInfo(Ty, SourceLocation());
+ std::pair<uint64_t, unsigned> TypeInfo = CGF.getContext().getTypeInfo(Ty);
// FIXME: Handle variable sized types.
const llvm::Type *IntPtr = llvm::IntegerType::get(CGF.LLVMPointerWidth);
diff --git a/CodeGen/CGExprConstant.cpp b/CodeGen/CGExprConstant.cpp
index 30180c1..e2405b8 100644
--- a/CodeGen/CGExprConstant.cpp
+++ b/CodeGen/CGExprConstant.cpp
@@ -37,7 +37,8 @@
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 @@
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 @@
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 @@
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);
}
diff --git a/CodeGen/CGExprScalar.cpp b/CodeGen/CGExprScalar.cpp
index 52b022b..892712a 100644
--- a/CodeGen/CGExprScalar.cpp
+++ b/CodeGen/CGExprScalar.cpp
@@ -656,16 +656,14 @@
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 @@
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 @@
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");
diff --git a/CodeGen/CodeGenFunction.cpp b/CodeGen/CodeGenFunction.cpp
index adbb414..f48d093 100644
--- a/CodeGen/CodeGenFunction.cpp
+++ b/CodeGen/CodeGenFunction.cpp
@@ -59,8 +59,7 @@
void CodeGenFunction::GenerateCode(const FunctionDecl *FD) {
LLVMIntTy = ConvertType(getContext().IntTy);
LLVMPointerWidth = static_cast<unsigned>(
- getContext().getTypeSize(getContext().getPointerType(getContext().VoidTy),
- SourceLocation()));
+ getContext().getTypeSize(getContext().getPointerType(getContext().VoidTy)));
CurFuncDecl = FD;
CurFn = cast<llvm::Function>(CGM.GetAddrOfFunctionDecl(FD, true));
diff --git a/CodeGen/CodeGenModule.cpp b/CodeGen/CodeGenModule.cpp
index 1a69796..554fc3f 100644
--- a/CodeGen/CodeGenModule.cpp
+++ b/CodeGen/CodeGenModule.cpp
@@ -231,7 +231,7 @@
Init = llvm::Constant::getNullValue(GV->getType()->getElementType());
} else if (D->getType()->isIntegerType()) {
llvm::APSInt Value(static_cast<uint32_t>(
- getContext().getTypeSize(D->getInit()->getType(), SourceLocation())));
+ getContext().getTypeSize(D->getInit()->getType())));
if (D->getInit()->isIntegerConstantExpr(Value, Context))
Init = llvm::ConstantInt::get(Value);
}
@@ -340,7 +340,7 @@
if (MemCpyFn) return MemCpyFn;
llvm::Intrinsic::ID IID;
uint64_t Size; unsigned Align;
- Context.Target.getPointerInfo(Size, Align, FullSourceLoc());
+ Context.Target.getPointerInfo(Size, Align);
switch (Size) {
default: assert(0 && "Unknown ptr width");
case 32: IID = llvm::Intrinsic::memcpy_i32; break;
@@ -353,7 +353,7 @@
if (MemSetFn) return MemSetFn;
llvm::Intrinsic::ID IID;
uint64_t Size; unsigned Align;
- Context.Target.getPointerInfo(Size, Align, FullSourceLoc());
+ Context.Target.getPointerInfo(Size, Align);
switch (Size) {
default: assert(0 && "Unknown ptr width");
case 32: IID = llvm::Intrinsic::memset_i32; break;
diff --git a/CodeGen/CodeGenTypes.cpp b/CodeGen/CodeGenTypes.cpp
index efdc0e8..9a669e8 100644
--- a/CodeGen/CodeGenTypes.cpp
+++ b/CodeGen/CodeGenTypes.cpp
@@ -118,8 +118,7 @@
return R;
// Otherwise, return an integer of the target-specified size.
- unsigned BoolWidth = (unsigned)Context.getTypeSize(T, SourceLocation());
- return llvm::IntegerType::get(BoolWidth);
+ return llvm::IntegerType::get((unsigned)Context.getTypeSize(T));
}
@@ -179,7 +178,7 @@
case BuiltinType::LongLong:
case BuiltinType::ULongLong:
return llvm::IntegerType::get(
- static_cast<unsigned>(Context.getTypeSize(T, SourceLocation())));
+ static_cast<unsigned>(Context.getTypeSize(T)));
case BuiltinType::Float: return llvm::Type::FloatTy;
case BuiltinType::Double: return llvm::Type::DoubleTy;
@@ -356,7 +355,7 @@
for (unsigned i = 0, e = RD->getNumMembers(); i != e; ++i)
RO.addField(RD->getMember(i));
- RO.layoutStructFields(Context.getASTRecordLayout(RD, SourceLocation()));
+ RO.layoutStructFields(Context.getASTRecordLayout(RD));
// Get llvm::StructType.
CGRecordLayouts[TD] = new CGRecordLayout(RO.getLLVMType(),
@@ -514,7 +513,7 @@
unsigned PrimaryEltNo = 0;
std::pair<uint64_t, unsigned> PrimaryElt =
- CGT.getContext().getTypeInfo(FieldDecls[0]->getType(), SourceLocation());
+ CGT.getContext().getTypeInfo(FieldDecls[0]->getType());
CGT.addFieldInfo(FieldDecls[0], 0);
unsigned Size = FieldDecls.size();
@@ -522,7 +521,7 @@
const FieldDecl *FD = FieldDecls[i];
assert (!FD->isBitField() && "Bit fields are not yet supported");
std::pair<uint64_t, unsigned> EltInfo =
- CGT.getContext().getTypeInfo(FD->getType(), SourceLocation());
+ CGT.getContext().getTypeInfo(FD->getType());
// Use largest element, breaking ties with the hightest aligned member.
if (EltInfo.first > PrimaryElt.first ||