diff options
author | Chris Lattner <sabre@nondot.org> | 2007-09-04 02:34:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-09-04 02:34:27 +0000 |
commit | 47f7dbf7c0b25505ad093a317983a9b39efe0610 (patch) | |
tree | 4289258983faf1b620a192c12e5d7ef3d3adf4c6 | |
parent | 34eff3929a04d69c2e10f11774145c411c880d24 (diff) |
eliminate some VC++ warnings, patch contributed by Hartmut Kaiser
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41692 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | CodeGen/CGExprScalar.cpp | 2 | ||||
-rw-r--r-- | CodeGen/CodeGenFunction.cpp | 4 | ||||
-rw-r--r-- | CodeGen/CodeGenModule.cpp | 4 | ||||
-rw-r--r-- | CodeGen/CodeGenTypes.cpp | 3 |
4 files changed, 7 insertions, 6 deletions
diff --git a/CodeGen/CGExprScalar.cpp b/CodeGen/CGExprScalar.cpp index 1cc33bdf18..e0a871831e 100644 --- a/CodeGen/CGExprScalar.cpp +++ b/CodeGen/CGExprScalar.cpp @@ -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)); } diff --git a/CodeGen/CodeGenFunction.cpp b/CodeGen/CodeGenFunction.cpp index 389bd05a70..d540ea7aa8 100644 --- a/CodeGen/CodeGenFunction.cpp +++ b/CodeGen/CodeGenFunction.cpp @@ -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; diff --git a/CodeGen/CodeGenModule.cpp b/CodeGen/CodeGenModule.cpp index ec3d0affae..a26e129336 100644 --- a/CodeGen/CodeGenModule.cpp +++ b/CodeGen/CodeGenModule.cpp @@ -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); } diff --git a/CodeGen/CodeGenTypes.cpp b/CodeGen/CodeGenTypes.cpp index 85d55844b4..46668e45d8 100644 --- a/CodeGen/CodeGenTypes.cpp +++ b/CodeGen/CodeGenTypes.cpp @@ -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; |