forked from OSchip/llvm-project
eliminate some VC++ warnings, patch contributed by Hartmut Kaiser
llvm-svn: 41692
This commit is contained in:
parent
e15fa6c89c
commit
fb2eb6941a
|
@ -517,7 +517,7 @@ Value *ScalarExprEmitter::EmitSizeAlignOf(QualType TypeToSize,
|
|||
|
||||
assert(RetType->isIntegerType() && "Result type must be an integer!");
|
||||
|
||||
unsigned ResultWidth = CGF.getContext().getTypeSize(RetType,SourceLocation());
|
||||
unsigned ResultWidth = static_cast<unsigned>(CGF.getContext().getTypeSize(RetType,SourceLocation()));
|
||||
return llvm::ConstantInt::get(llvm::APInt(ResultWidth, Val));
|
||||
}
|
||||
|
||||
|
|
|
@ -51,9 +51,9 @@ bool CodeGenFunction::hasAggregateLLVMType(QualType T) {
|
|||
|
||||
void CodeGenFunction::GenerateCode(const FunctionDecl *FD) {
|
||||
LLVMIntTy = ConvertType(getContext().IntTy);
|
||||
LLVMPointerWidth =
|
||||
LLVMPointerWidth = static_cast<unsigned>(
|
||||
getContext().getTypeSize(getContext().getPointerType(getContext().VoidTy),
|
||||
SourceLocation());
|
||||
SourceLocation()));
|
||||
|
||||
CurFn = cast<llvm::Function>(CGM.GetAddrOfGlobalDecl(FD));
|
||||
CurFuncDecl = FD;
|
||||
|
|
|
@ -67,8 +67,8 @@ void CodeGenModule::EmitGlobalVar(const FileVarDecl *D) {
|
|||
if (D->getInit() == 0) {
|
||||
Init = llvm::Constant::getNullValue(GV->getType()->getElementType());
|
||||
} else if (D->getType()->isIntegerType()) {
|
||||
llvm::APSInt Value(getContext().getTypeSize(D->getInit()->getType(),
|
||||
SourceLocation()));
|
||||
llvm::APSInt Value(static_cast<unsigned>(
|
||||
getContext().getTypeSize(D->getInit()->getType(), SourceLocation())));
|
||||
if (D->getInit()->isIntegerConstantExpr(Value, Context))
|
||||
Init = llvm::ConstantInt::get(Value);
|
||||
}
|
||||
|
|
|
@ -58,7 +58,8 @@ const llvm::Type *CodeGenTypes::ConvertType(QualType T) {
|
|||
case BuiltinType::ULong:
|
||||
case BuiltinType::LongLong:
|
||||
case BuiltinType::ULongLong:
|
||||
return llvm::IntegerType::get(Context.getTypeSize(T, SourceLocation()));
|
||||
return llvm::IntegerType::get(
|
||||
static_cast<unsigned>(Context.getTypeSize(T, SourceLocation())));
|
||||
|
||||
case BuiltinType::Float: return llvm::Type::FloatTy;
|
||||
case BuiltinType::Double: return llvm::Type::DoubleTy;
|
||||
|
|
Loading…
Reference in New Issue