summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetMachine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/TargetMachine.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index 826766890dd..2a0968565f2 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/lib/Target/TargetMachine.cpp
@@ -192,6 +192,14 @@ bool TargetMachine::shouldAssumeDSOLocal(const Module &M,
return false;
}
+bool TargetMachine::useEmulatedTLS() const {
+ // Returns Options.EmulatedTLS if the -emulated-tls or -no-emulated-tls
+ // was specified explicitly; otherwise uses target triple to decide default.
+ if (Options.ExplicitEmulatedTLS)
+ return Options.EmulatedTLS;
+ return getTargetTriple().hasDefaultEmulatedTLS();
+}
+
TLSModel::Model TargetMachine::getTLSModel(const GlobalValue *GV) const {
bool IsPIE = GV->getParent()->getPIELevel() != PIELevel::Default;
Reloc::Model RM = getRelocationModel();
OpenPOWER on IntegriCloud