[llvm-commits] [llvm-gcc-4.2] r43458 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Dale Johannesen dalej at apple.com
Mon Oct 29 11:33:25 PDT 2007


Author: johannes
Date: Mon Oct 29 13:33:25 2007
New Revision: 43458

URL: http://llvm.org/viewvc/llvm-project?rev=43458&view=rev
Log:
Eliminate annoying warning.


Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=43458&r1=43457&r2=43458&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Oct 29 13:33:25 2007
@@ -5871,7 +5871,13 @@
     // The lvalue is just the address.
     return Convert(TREE_OPERAND(exp, 0));
   case COMPOUND_LITERAL_EXPR: // FIXME: not gimple - defined by C front-end
-    return EmitLV(COMPOUND_LITERAL_EXPR_DECL(exp));
+    /* This used to read 
+       return EmitLV(COMPOUND_LITERAL_EXPR_DECL(exp));
+       but gcc warns about that and there doesn't seem to be any way to stop it 
+       with casts or the like.  The following is equivalent with no checking
+       (since we know TREE_CODE(exp) is COMPOUND_LITERAL_EXPR the checking 
+       doesn't accomplish anything anyway). */
+    return EmitLV(DECL_EXPR_DECL (TREE_OPERAND (exp, 0)));
   }
 }
 





More information about the llvm-commits mailing list