From 34f94f93dc20e08c9327441e4b5bcbce9ba23e9c Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 4 Jun 2013 04:45:03 +0000 Subject: Remove some unreachable (and wrong) code and replace it with an assertion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183206 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 28eae50832..501d7ecfa3 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -361,19 +361,9 @@ EmitExprForReferenceBinding(CodeGenFunction &CGF, const Expr *E, case SubobjectAdjustment::FieldAdjustment: { LValue LV = CGF.MakeAddrLValue(Object, E->getType()); LV = CGF.EmitLValueForField(LV, Adjustment.Field); - if (LV.isSimple()) { - Object = LV.getAddress(); - break; - } - - // For non-simple lvalues, we actually have to create a copy of - // the object we're binding to. - QualType T = Adjustment.Field->getType().getNonReferenceType() - .getUnqualifiedType(); - Object = CreateReferenceTemporary(CGF, T, InitializedDecl); - LValue TempLV = CGF.MakeAddrLValue(Object, - Adjustment.Field->getType()); - CGF.EmitStoreThroughLValue(CGF.EmitLoadOfLValue(LV), TempLV); + assert(LV.isSimple() && + "materialized temporary field is not a simple lvalue"); + Object = LV.getAddress(); break; } -- cgit v1.2.3