as eli points out, we're not doing memory stuff here. While ConvertType

and ConvertTypeForMem are the same for pointers, it is best to just
use ConvertType.  Thanks Eli!

llvm-svn: 135567
This commit is contained in:
Chris Lattner 2011-07-20 04:59:57 +00:00
parent 2210448520
commit 245169620a
2 changed files with 2 additions and 3 deletions

View File

@ -174,7 +174,7 @@ namespace {
}
static llvm::Value *
CreateReferenceTemporary(CodeGenFunction& CGF, QualType Type,
CreateReferenceTemporary(CodeGenFunction &CGF, QualType Type,
const NamedDecl *InitializedDecl) {
if (const VarDecl *VD = dyn_cast_or_null<VarDecl>(InitializedDecl)) {
if (VD->hasGlobalStorage()) {

View File

@ -1077,8 +1077,7 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
// Make sure the array decay ends up being the right type. This matters if
// the array type was of an incomplete type.
return CGF.Builder.CreateBitCast(V,
CGF.getTypes().ConvertTypeForMem(CE->getType()));
return CGF.Builder.CreateBitCast(V, ConvertType(CE->getType()));
}
case CK_FunctionToPointerDecay:
return EmitLValue(E).getAddress();