[cfe-commits] r106980 - /cfe/trunk/lib/CodeGen/CGExpr.cpp
Anders Carlsson
andersca at mac.com
Sun Jun 27 08:24:55 PDT 2010
Author: andersca
Date: Sun Jun 27 10:24:55 2010
New Revision: 106980
URL: http://llvm.org/viewvc/llvm-project?rev=106980&view=rev
Log:
Reduce indentation.
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=106980&r1=106979&r2=106980&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Sun Jun 27 10:24:55 2010
@@ -325,26 +325,23 @@
}
}
- const llvm::Type *ResultPtrTy
- = llvm::PointerType::get(ConvertType(ResultTy), 0);
+ const llvm::Type *ResultPtrTy = ConvertType(ResultTy)->getPointerTo();
Object = Builder.CreateBitCast(Object, ResultPtrTy, "temp");
return RValue::get(Object);
}
}
- if (Val.isAggregate()) {
- Val = RValue::get(Val.getAggregateAddr());
- } else {
- // Create a temporary variable that we can bind the reference to.
- llvm::Value *Temp = CreateMemTemp(E->getType(), "reftmp");
- if (Val.isScalar())
- EmitStoreOfScalar(Val.getScalarVal(), Temp, false, E->getType());
- else
- StoreComplexToAddr(Val.getComplexVal(), Temp, false);
- Val = RValue::get(Temp);
- }
+ if (Val.isAggregate())
+ return RValue::get(Val.getAggregateAddr());
+
+ // Create a temporary variable that we can bind the reference to.
+ llvm::Value *Temp = CreateMemTemp(E->getType(), "reftmp");
+ if (Val.isScalar())
+ EmitStoreOfScalar(Val.getScalarVal(), Temp, false, E->getType());
+ else
+ StoreComplexToAddr(Val.getComplexVal(), Temp, false);
- return Val;
+ return RValue::get(Temp);
}
More information about the cfe-commits
mailing list