Put each jump table in an independent section if the function is too.

This allows the linker to GC both, fixing pr22557.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228937 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2015-02-12 17:16:46 +00:00
parent a858be4291
commit 8eeedf74d3
7 changed files with 100 additions and 6 deletions

View File

@@ -270,6 +270,11 @@ SectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler &Mang,
return SelectSectionForGlobal(GV, Kind, Mang, TM);
}
const MCSection *TargetLoweringObjectFile::getSectionForJumpTable(
const Function &F, Mangler &Mang, const TargetMachine &TM) const {
return getSectionForConstant(SectionKind::getReadOnly(), /*C=*/nullptr);
}
/// getSectionForConstant - Given a mergable constant with the
/// specified size and relocation information, return a section that it
/// should be placed in.