make SectionKindForGlobal target independent, and therefore non-virtual.
It's classifications now include elf-specific discriminators. Targets
that don't have these features (like darwin and pecoff) simply treat
data.rel like data, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76993 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp
index 27714f2..2d3c5ff 100644
--- a/lib/Target/DarwinTargetAsmInfo.cpp
+++ b/lib/Target/DarwinTargetAsmInfo.cpp
@@ -131,19 +131,24 @@
bool isNonStatic = TM.getRelocationModel() != Reloc::Static;
switch (Kind) {
+ case SectionKind::ThreadData:
+ case SectionKind::ThreadBSS:
+ llvm_unreachable("Darwin doesn't support TLS");
case SectionKind::Text:
if (isWeak)
return TextCoalSection;
return TextSection;
case SectionKind::Data:
- case SectionKind::ThreadData:
+ case SectionKind::DataRelLocal:
+ case SectionKind::DataRel:
case SectionKind::BSS:
- case SectionKind::ThreadBSS:
if (cast<GlobalVariable>(GV)->isConstant())
return isWeak ? ConstDataCoalSection : ConstDataSection;
return isWeak ? DataCoalSection : DataSection;
case SectionKind::ROData:
+ case SectionKind::DataRelRO:
+ case SectionKind::DataRelROLocal:
return (isWeak ? ConstDataCoalSection :
(isNonStatic ? ConstDataSection : getReadOnlySection()));
case SectionKind::RODataMergeStr: