diff options
author | Hans Wennborg <hans@hanshq.net> | 2012-06-28 08:01:44 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2012-06-28 08:01:44 +0000 |
commit | de981f3ff163bc9ec69e4c5e7316e94276412993 (patch) | |
tree | 5b965d25849d6216a431f45337cd6601efa2e632 /lib/CodeGen/CodeGenModule.h | |
parent | b6ebd4490235c9ea6016530d623c46d0b9ce565b (diff) |
Add -ftls-model command-line flag.
This allows for setting the default TLS model. (PR9788)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159336 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | lib/CodeGen/CodeGenModule.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index a742d846c1..d6ff50d5ad 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -474,6 +474,10 @@ public: /// GlobalValue. void setGlobalVisibility(llvm::GlobalValue *GV, const NamedDecl *D) const; + /// setTLSMode - Set the TLS mode for the given LLVM GlobalVariable + /// for the thread-local variable declaration D. + void setTLSMode(llvm::GlobalVariable *GV, const VarDecl &D) const; + /// TypeVisibilityKind - The kind of global variable that is passed to /// setTypeVisibility enum TypeVisibilityKind { @@ -498,15 +502,6 @@ public: llvm_unreachable("unknown visibility!"); } - static llvm::GlobalVariable::ThreadLocalMode GetLLVMTLSModel(StringRef S) { - return llvm::StringSwitch<llvm::GlobalVariable::ThreadLocalMode>(S) - .Case("global-dynamic", llvm::GlobalVariable::GeneralDynamicTLSModel) - .Case("local-dynamic", llvm::GlobalVariable::LocalDynamicTLSModel) - .Case("initial-exec", llvm::GlobalVariable::InitialExecTLSModel) - .Case("local-exec", llvm::GlobalVariable::LocalExecTLSModel) - .Default(llvm::GlobalVariable::NotThreadLocal); - } - llvm::Constant *GetAddrOfGlobal(GlobalDecl GD) { if (isa<CXXConstructorDecl>(GD.getDecl())) return GetAddrOfCXXConstructor(cast<CXXConstructorDecl>(GD.getDecl()), |