diff options
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 605f77975f9..c0dd68bc70b 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -92,9 +92,31 @@ RValue CodeGenFunction::EmitAnyExprToTemp(const Expr *E, IsInitializer); } +llvm::Value * +CodeGenFunction::EmitCXXBindReferenceExpr(const CXXBindReferenceExpr *E) { + QualType T = E->getType(); + assert(T->isAnyComplexType() && "FIXME: Unhandled bind expression!"); + + const Expr *SubExpr = E->getSubExpr(); + + if (!E->requiresTemporaryCopy()) + return EmitLValue(SubExpr).getAddress(); + + llvm::Value *Value = CreateTempAlloca(ConvertTypeForMem(T), "reftmp"); + + if (T->isAnyComplexType()) + EmitComplexExprIntoAddr(SubExpr, Value, /*DestIsVolatile=*/false); + else + assert(false && "Unhandled bind expression"); + + return Value; +} + RValue CodeGenFunction::EmitReferenceBindingToExpr(const Expr* E, QualType DestType, bool IsInitializer) { + assert(!E->getType()->isAnyComplexType() && + "Should not use this function for complex types!"); bool ShouldDestroyTemporaries = false; unsigned OldNumLiveTemporaries = 0; |