aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-11-17 10:53:13 +0000
committerBill Wendling <isanbard@gmail.com>2013-11-17 10:53:13 +0000
commitfe128c6ac8a6ae6aa85f0168f99d9c28de010fd8 (patch)
tree5f4ade1dbc840a77e8669d0007559f4e2dc29c1c /lib/CodeGen
parentd5ae5b018644345ba0fc48a47030ef1105e1abfd (diff)
downloadexternal_llvm-fe128c6ac8a6ae6aa85f0168f99d9c28de010fd8.zip
external_llvm-fe128c6ac8a6ae6aa85f0168f99d9c28de010fd8.tar.gz
external_llvm-fe128c6ac8a6ae6aa85f0168f99d9c28de010fd8.tar.bz2
Revert "Micro-optimization"
This reverts commit f1d9fe9d04ce93f6d5dcebbd2cb6a07414d7a029. This was causing PR17964. We need to use thread data before regular data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194960 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/TargetLoweringObjectFileImpl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 5d16f04..66ba3ec 100644
--- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -523,6 +523,11 @@ getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
const MCSection *TargetLoweringObjectFileMachO::
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
Mangler *Mang, const TargetMachine &TM) const {
+
+ // Handle thread local data.
+ if (Kind.isThreadBSS()) return TLSBSSSection;
+ if (Kind.isThreadData()) return TLSDataSection;
+
if (Kind.isText())
return GV->isWeakForLinker() ? TextCoalSection : TextSection;
@@ -575,10 +580,6 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
if (Kind.isBSSLocal())
return DataBSSSection;
- // Handle thread local data.
- if (Kind.isThreadBSS()) return TLSBSSSection;
- if (Kind.isThreadData()) return TLSDataSection;
-
// Otherwise, just drop the variable in the normal data section.
return DataSection;
}