[llvm-commits] [llvm] r78937 - in /llvm/trunk: include/llvm/MC/MCSectionELF.h lib/MC/MCSectionELF.cpp

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Thu Aug 13 14:08:57 PDT 2009


Author: bruno
Date: Thu Aug 13 16:08:56 2009
New Revision: 78937

URL: http://llvm.org/viewvc/llvm-project?rev=78937&view=rev
Log:
Add a method to return if the ELF section contains only common symbols!

Modified:
    llvm/trunk/include/llvm/MC/MCSectionELF.h
    llvm/trunk/lib/MC/MCSectionELF.cpp

Modified: llvm/trunk/include/llvm/MC/MCSectionELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionELF.h?rev=78937&r1=78936&r2=78937&view=diff

==============================================================================
--- llvm/trunk/include/llvm/MC/MCSectionELF.h (original)
+++ llvm/trunk/include/llvm/MC/MCSectionELF.h Thu Aug 13 16:08:56 2009
@@ -55,6 +55,9 @@
 
   /// ShouldPrintSectionType - Only prints the section type if supported
   bool ShouldPrintSectionType(unsigned Ty) const;
+
+  /// IsCommon - True if this section contains only common symbols
+  bool IsCommon() const;
   
   /// These are the section type and flags fields.  An ELF section can have
   /// only one Type, but can have more than one of the flags specified.

Modified: llvm/trunk/lib/MC/MCSectionELF.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCSectionELF.cpp?rev=78937&r1=78936&r2=78937&view=diff

==============================================================================
--- llvm/trunk/lib/MC/MCSectionELF.cpp (original)
+++ llvm/trunk/lib/MC/MCSectionELF.cpp Thu Aug 13 16:08:56 2009
@@ -121,3 +121,13 @@
   OS << '\n';
 }
 
+// IsCommon - True if this section contains only common symbols
+bool MCSectionELF::IsCommon() const {
+  
+  if (strncmp(SectionName.c_str(), ".gnu.linkonce.", 14) == 0)
+    return true;
+
+  return false;
+}
+
+





More information about the llvm-commits mailing list