Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Unified Diff: lib/Target/TargetMachine.cpp

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/Target/TargetLibraryInfo.cpp ('k') | lib/Target/X86/AsmParser/X86AsmParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Target/TargetMachine.cpp
diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp
index 309e1bf2786db8796bbbf360f30d8683a9aad9b1..cda41aa27e5c9bea9c19a98aabcacb72165b0598 100644
--- a/lib/Target/TargetMachine.cpp
+++ b/lib/Target/TargetMachine.cpp
@@ -30,6 +30,26 @@
using namespace llvm;
//---------------------------------------------------------------------------
+
+// @LOCALMOD-BEGIN
+namespace llvm {
+ bool TLSUseCall;
+}
+
+// Use a function call to get the thread pointer for TLS accesses,
+// instead of using inline code.
+static cl::opt<bool, true>
+EnableTLSUseCall("mtls-use-call",
+ cl::desc("Use a function call to get the thread pointer for TLS accesses."),
+ cl::location(TLSUseCall),
+ cl::init(false));
+
+static cl::opt<bool>
+ ForceTLSNonPIC("force-tls-non-pic",
+ cl::desc("Force TLS to use non-PIC models"),
+ cl::init(false));
+// @LOCALMOD-END
+
// TargetMachine Class
//
@@ -112,7 +132,8 @@ TLSModel::Model TargetMachine::getTLSModel(const GlobalValue *GV) const {
bool isHidden = GV->hasHiddenVisibility();
TLSModel::Model Model;
- if (isPIC && !isPIE) {
+ if (isPIC && !isPIE &&
+ !ForceTLSNonPIC) { // @LOCALMOD
if (isLocal || isHidden)
Model = TLSModel::LocalDynamic;
else
« no previous file with comments | « lib/Target/TargetLibraryInfo.cpp ('k') | lib/Target/X86/AsmParser/X86AsmParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698