[llvm-commits] [llvm-gcc-4.2] r55677 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp

Dale Johannesen dalej at apple.com
Tue Sep 2 16:44:14 PDT 2008


Author: johannes
Date: Tue Sep  2 18:44:13 2008
New Revision: 55677

URL: http://llvm.org/viewvc/llvm-project?rev=55677&view=rev
Log:
Fix visibility in ObjC at -O0.  When redoing type and/or
initialization late, after the symbol has changed, we need
to consider visibility also.


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

Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=55677&r1=55676&r2=55677&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Tue Sep  2 18:44:13 2008
@@ -895,6 +895,9 @@
   // Get or create the global variable now.
   GlobalVariable *GV = cast<GlobalVariable>(DECL_LLVM(decl));
   
+  // Visibility may also have changed.
+  handleVisibility(decl, GV);
+
   // Convert the initializer over.
   Constant *Init = TreeConstantToLLVM::Convert(DECL_INITIAL(decl));
 
@@ -915,6 +918,9 @@
   // Get or create the global variable now.
   GlobalVariable *GV = cast<GlobalVariable>(DECL_LLVM(decl));
   
+  // Visibility may also have changed.
+  handleVisibility(decl, GV);
+
   // Temporary to avoid infinite recursion (see comments emit_global_to_llvm)
   GV->setInitializer(UndefValue::get(GV->getType()->getElementType()));
 





More information about the llvm-commits mailing list