Author: asl Date: Thu Jul 26 08:18:48 2007 New Revision: 40525 URL: http://llvm.org/viewvc/llvm-project?rev=40525&view=rev Log: Emit globals to LLVM properly (when they appear as lvalue's)
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=40525&r1=40524&r2=40525&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Jul 26 08:18:48 2007 @@ -5048,7 +5048,7 @@ // If this is an aggregate, emit it to LLVM now. GCC happens to // get this case right by forcing the initializer into memory. if (TREE_CODE(exp) == CONST_DECL || TREE_CODE(exp) == VAR_DECL) { - if (DECL_INITIAL(exp) && GV->isDeclaration()) { + if (GV->isDeclaration()) { emit_global_to_llvm(exp); Decl = DECL_LLVM(exp); // Decl could have change if it changed type. } @@ -6128,7 +6128,7 @@ // If this is an aggregate, emit it to LLVM now. GCC happens to // get this case right by forcing the initializer into memory. if (TREE_CODE(exp) == CONST_DECL || TREE_CODE(exp) == VAR_DECL) { - if (DECL_INITIAL(exp) && Val->isDeclaration()) { + if (Val->isDeclaration()) { emit_global_to_llvm(exp); // Decl could have change if it changed type. Val = cast<GlobalValue>(DECL_LLVM(exp)); _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits