[cfe-commits] r41692 - in /cfe/trunk/CodeGen: CGExprScalar.cpp CodeGenFunction.cpp CodeGenModule.cpp CodeGenTypes.cpp
Chris Lattner
sabre at nondot.org
Mon Sep 3 19:34:27 PDT 2007
Author: lattner
Date: Mon Sep 3 21:34:27 2007
New Revision: 41692
URL: http://llvm.org/viewvc/llvm-project?rev=41692&view=rev
Log:
eliminate some VC++ warnings, patch contributed by Hartmut Kaiser
Modified:
cfe/trunk/CodeGen/CGExprScalar.cpp
cfe/trunk/CodeGen/CodeGenFunction.cpp
cfe/trunk/CodeGen/CodeGenModule.cpp
cfe/trunk/CodeGen/CodeGenTypes.cpp
Modified: cfe/trunk/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExprScalar.cpp?rev=41692&r1=41691&r2=41692&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/CodeGen/CGExprScalar.cpp Mon Sep 3 21:34:27 2007
@@ -517,7 +517,7 @@
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));
}
Modified: cfe/trunk/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenFunction.cpp?rev=41692&r1=41691&r2=41692&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenFunction.cpp Mon Sep 3 21:34:27 2007
@@ -51,9 +51,9 @@
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;
Modified: cfe/trunk/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenModule.cpp?rev=41692&r1=41691&r2=41692&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenModule.cpp Mon Sep 3 21:34:27 2007
@@ -67,8 +67,8 @@
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);
}
Modified: cfe/trunk/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenTypes.cpp?rev=41692&r1=41691&r2=41692&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenTypes.cpp Mon Sep 3 21:34:27 2007
@@ -58,7 +58,8 @@
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;
More information about the cfe-commits
mailing list