[llvm-commits] [llvm] r77084 - in /llvm/trunk: include/llvm/Target/TargetAsmInfo.h lib/Target/TargetAsmInfo.cpp

Chris Lattner sabre at nondot.org
Sat Jul 25 11:11:58 PDT 2009


Author: lattner
Date: Sat Jul 25 13:11:58 2009
New Revision: 77084

URL: http://llvm.org/viewvc/llvm-project?rev=77084&view=rev
Log:
document some invariants.

Modified:
    llvm/trunk/include/llvm/Target/TargetAsmInfo.h
    llvm/trunk/lib/Target/TargetAsmInfo.cpp

Modified: llvm/trunk/include/llvm/Target/TargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetAsmInfo.h?rev=77084&r1=77083&r2=77084&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/TargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Sat Jul 25 13:11:58 2009
@@ -592,9 +592,10 @@
       return 0;
     }
     
-    /// SectionForGlobal - This hooks returns proper section name for given
-    /// global with all necessary flags and marks.
-    // FIXME: MOVE TO TARGETLOWERING.
+    /// SectionForGlobal - This method computes the appropriate section to emit
+    /// the specified global variable or function definition.  This should not
+    /// be passed external (or available externally) globals.
+    // FIXME: MOVE TO ASMPRINTER.
     const Section* SectionForGlobal(const GlobalValue *GV) const;
     
     /// getSpecialCasedSectionGlobals - Allow the target to completely override

Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=77084&r1=77083&r2=77084&view=diff

==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Sat Jul 25 13:11:58 2009
@@ -293,8 +293,13 @@
   }
 }
 
-
+/// SectionForGlobal - This method computes the appropriate section to emit
+/// the specified global variable or function definition.  This should not
+/// be passed external (or available externally) globals.
 const Section *TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const {
+  assert(!GV->isDeclaration() && !GV->hasAvailableExternallyLinkage() &&
+         "Can only be used for global definitions");
+  
   SectionKind::Kind Kind = SectionKindForGlobal(GV, TM.getRelocationModel());
 
   // Select section name.





More information about the llvm-commits mailing list