Skip to content

Commit 35a12a8

Browse files
committed
Remove a bit of dead code.
Every "real" object file implements this an ptx doesn't use it. llvm-svn: 221746
1 parent 17c00b4 commit 35a12a8

File tree

4 files changed

+11
-20
lines changed

4 files changed

+11
-20
lines changed

llvm/include/llvm/Target/TargetLoweringObjectFile.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class TargetLoweringObjectFile : public MCObjectFileInfo {
160160
protected:
161161
virtual const MCSection *
162162
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
163-
Mangler &Mang, const TargetMachine &TM) const;
163+
Mangler &Mang, const TargetMachine &TM) const = 0;
164164
};
165165

166166
} // end namespace llvm

llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -4496,3 +4496,10 @@ NVPTXTargetObjectFile::~NVPTXTargetObjectFile() {
44964496
delete DwarfRangesSection;
44974497
delete DwarfMacroInfoSection;
44984498
}
4499+
4500+
const MCSection *
4501+
NVPTXTargetObjectFile::SelectSectionForGlobal(const GlobalValue *GV,
4502+
SectionKind Kind, Mangler &Mang,
4503+
const TargetMachine &TM) const {
4504+
return getDataSection();
4505+
}

llvm/lib/Target/NVPTX/NVPTXTargetObjectFile.h

+3
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ class NVPTXTargetObjectFile : public TargetLoweringObjectFile {
9898
return DataSection;
9999
}
100100

101+
const MCSection *
102+
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler &Mang,
103+
const TargetMachine &TM) const override;
101104
};
102105

103106
} // end namespace llvm

llvm/lib/Target/TargetLoweringObjectFile.cpp

-19
Original file line numberDiff line numberDiff line change
@@ -275,25 +275,6 @@ bool TargetLoweringObjectFile::isSectionAtomizableBySymbols(
275275
return false;
276276
}
277277

278-
// Lame default implementation. Calculate the section name for global.
279-
const MCSection *
280-
TargetLoweringObjectFile::SelectSectionForGlobal(const GlobalValue *GV,
281-
SectionKind Kind,
282-
Mangler &Mang,
283-
const TargetMachine &TM) const{
284-
assert(!Kind.isThreadLocal() && "Doesn't support TLS");
285-
286-
if (Kind.isText())
287-
return getTextSection();
288-
289-
if (Kind.isBSS() && BSSSection != nullptr)
290-
return BSSSection;
291-
292-
if (Kind.isReadOnly() && ReadOnlySection != nullptr)
293-
return ReadOnlySection;
294-
295-
return getDataSection();
296-
}
297278

298279
/// getSectionForConstant - Given a mergable constant with the
299280
/// specified size and relocation information, return a section that it

0 commit comments

Comments
 (0)