[llvm] r221746 - Remove a bit of dead code.

Rafael Espindola rafael.espindola at gmail.com
Tue Nov 11 17:27:22 PST 2014


Author: rafael
Date: Tue Nov 11 19:27:22 2014
New Revision: 221746

URL: http://llvm.org/viewvc/llvm-project?rev=221746&view=rev
Log:
Remove a bit of dead code.

Every "real" object file implements this an ptx doesn't use it.

Modified:
    llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h
    llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp
    llvm/trunk/lib/Target/NVPTX/NVPTXTargetObjectFile.h
    llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp

Modified: llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h?rev=221746&r1=221745&r2=221746&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h (original)
+++ llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h Tue Nov 11 19:27:22 2014
@@ -160,7 +160,7 @@ public:
 protected:
   virtual const MCSection *
   SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
-                         Mangler &Mang, const TargetMachine &TM) const;
+                         Mangler &Mang, const TargetMachine &TM) const = 0;
 };
 
 } // end namespace llvm

Modified: llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp?rev=221746&r1=221745&r2=221746&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp Tue Nov 11 19:27:22 2014
@@ -4496,3 +4496,10 @@ NVPTXTargetObjectFile::~NVPTXTargetObjec
   delete DwarfRangesSection;
   delete DwarfMacroInfoSection;
 }
+
+const MCSection *
+NVPTXTargetObjectFile::SelectSectionForGlobal(const GlobalValue *GV,
+                                              SectionKind Kind, Mangler &Mang,
+                                              const TargetMachine &TM) const {
+  return getDataSection();
+}

Modified: llvm/trunk/lib/Target/NVPTX/NVPTXTargetObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXTargetObjectFile.h?rev=221746&r1=221745&r2=221746&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXTargetObjectFile.h (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXTargetObjectFile.h Tue Nov 11 19:27:22 2014
@@ -98,6 +98,9 @@ public:
     return DataSection;
   }
 
+  const MCSection *
+  SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler &Mang,
+                         const TargetMachine &TM) const override;
 };
 
 } // end namespace llvm

Modified: llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp?rev=221746&r1=221745&r2=221746&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp (original)
+++ llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp Tue Nov 11 19:27:22 2014
@@ -275,25 +275,6 @@ bool TargetLoweringObjectFile::isSection
   return false;
 }
 
-// Lame default implementation. Calculate the section name for global.
-const MCSection *
-TargetLoweringObjectFile::SelectSectionForGlobal(const GlobalValue *GV,
-                                                 SectionKind Kind,
-                                                 Mangler &Mang,
-                                                 const TargetMachine &TM) const{
-  assert(!Kind.isThreadLocal() && "Doesn't support TLS");
-
-  if (Kind.isText())
-    return getTextSection();
-
-  if (Kind.isBSS() && BSSSection != nullptr)
-    return BSSSection;
-
-  if (Kind.isReadOnly() && ReadOnlySection != nullptr)
-    return ReadOnlySection;
-
-  return getDataSection();
-}
 
 /// getSectionForConstant - Given a mergable constant with the
 /// specified size and relocation information, return a section that it





More information about the llvm-commits mailing list