[llvm-commits] [llvm] r122241 -	/llvm/trunk/include/llvm/GlobalValue.h
    Duncan Sands 
    baldrick at free.fr
       
    Mon Dec 20 02:57:01 PST 2010
    
    
  
Author: baldrick
Date: Mon Dec 20 04:57:01 2010
New Revision: 122241
URL: http://llvm.org/viewvc/llvm-project?rev=122241&view=rev
Log:
Discourage people from using isWeakForLinker when they should be using
mayBeOverridden.
Modified:
    llvm/trunk/include/llvm/GlobalValue.h
Modified: llvm/trunk/include/llvm/GlobalValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/GlobalValue.h?rev=122241&r1=122240&r2=122241&view=diff
==============================================================================
--- llvm/trunk/include/llvm/GlobalValue.h (original)
+++ llvm/trunk/include/llvm/GlobalValue.h Mon Dec 20 04:57:01 2010
@@ -173,7 +173,9 @@
   }
 
   /// isWeakForLinker - Whether the definition of this global may be replaced at
-  /// link time.
+  /// link time.  NB: Using this method outside of the code generators is almost
+  /// always a mistake: when working at the IR level use mayBeOverridden instead
+  /// as it knows about ODR semantics.
   static bool isWeakForLinker(LinkageTypes Linkage)  {
     return Linkage == AvailableExternallyLinkage ||
            Linkage == WeakAnyLinkage ||
    
    
More information about the llvm-commits
mailing list