From dc70865b5bec0118889262df38f8a68d77760553 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 12 Nov 2014 01:27:22 +0000 Subject: [PATCH] Remove a bit of dead code. 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 | 2 +- lib/Target/NVPTX/NVPTXISelLowering.cpp | 7 +++++++ lib/Target/NVPTX/NVPTXTargetObjectFile.h | 3 +++ lib/Target/TargetLoweringObjectFile.cpp | 19 ------------------- 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/include/llvm/Target/TargetLoweringObjectFile.h b/include/llvm/Target/TargetLoweringObjectFile.h index 7c32a5e3d0c..7fcb171ab3d 100644 --- a/include/llvm/Target/TargetLoweringObjectFile.h +++ b/include/llvm/Target/TargetLoweringObjectFile.h @@ -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 diff --git a/lib/Target/NVPTX/NVPTXISelLowering.cpp b/lib/Target/NVPTX/NVPTXISelLowering.cpp index 866017e49db..26d0b4c8c92 100644 --- a/lib/Target/NVPTX/NVPTXISelLowering.cpp +++ b/lib/Target/NVPTX/NVPTXISelLowering.cpp @@ -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(); +} diff --git a/lib/Target/NVPTX/NVPTXTargetObjectFile.h b/lib/Target/NVPTX/NVPTXTargetObjectFile.h index c9b091e1c69..00ceca50a9f 100644 --- a/lib/Target/NVPTX/NVPTXTargetObjectFile.h +++ b/lib/Target/NVPTX/NVPTXTargetObjectFile.h @@ -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 diff --git a/lib/Target/TargetLoweringObjectFile.cpp b/lib/Target/TargetLoweringObjectFile.cpp index e63bc2b69cc..01139fb20cf 100644 --- a/lib/Target/TargetLoweringObjectFile.cpp +++ b/lib/Target/TargetLoweringObjectFile.cpp @@ -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 -- 2.11.0