Remove a bit of dead code.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 12 Nov 2014 01:27:22 +0000 (01:27 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 12 Nov 2014 01:27:22 +0000 (01:27 +0000)
Every "real" object file implements this an ptx doesn't use it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221746 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 7c32a5e3d0ca8c807fe4be99575505766d5a7560..7fcb171ab3d3555fbd7a920452d3fb6701bd5d9f 100644 (file)
@@ -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
index 866017e49db5c6cebdf48c96d4f26f68cfd0b897..26d0b4c8c9223f9ddb60999506be9962650551d7 100644 (file)
@@ -4496,3 +4496,10 @@ NVPTXTargetObjectFile::~NVPTXTargetObjectFile() {
   delete DwarfRangesSection;
   delete DwarfMacroInfoSection;
 }
+
+const MCSection *
+NVPTXTargetObjectFile::SelectSectionForGlobal(const GlobalValue *GV,
+                                              SectionKind Kind, Mangler &Mang,
+                                              const TargetMachine &TM) const {
+  return getDataSection();
+}
index c9b091e1c69c319736ca213a619a1dc0eaa92797..00ceca50a9f22c0510f784224cb124c66549cbb1 100644 (file)
@@ -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
index e63bc2b69ccf6ae299ed4c7726a2f3efc8113e23..01139fb20cfbc65a1c3a31c2c6f408bc3231ca26 100644 (file)
@@ -275,25 +275,6 @@ bool TargetLoweringObjectFile::isSectionAtomizableBySymbols(
   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