diff options
| author | Anders Carlsson <andersca@mac.com> | 2010-06-27 15:24:55 +0000 |
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2010-06-27 15:24:55 +0000 |
| commit | cc09785424b056196c397862fca85806dd6ccc84 (patch) | |
| tree | b34cf5a70b59b3546bdf0a3cb4f94bc0b27f9e20 /lib/CodeGen/CGExpr.cpp | |
| parent | fbe02ffb573ac2aa51351278af1c7970573b6ed5 (diff) | |
| download | clang-cc09785424b056196c397862fca85806dd6ccc84.tar.gz clang-cc09785424b056196c397862fca85806dd6ccc84.tar.bz2 clang-cc09785424b056196c397862fca85806dd6ccc84.tar.xz | |
Reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106980 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
| -rw-r--r-- | lib/CodeGen/CGExpr.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 46db4e98e7..44cdcf0794 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -325,26 +325,23 @@ CodeGenFunction::EmitReferenceBindingToExpr(const Expr* E, } } - 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); } |
