From f60f6af9e84fe7752edb6fa42464778ac8a53e99 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Thu, 28 Jun 2012 08:01:44 +0000 Subject: Add -ftls-model command-line flag. This allows for setting the default TLS model. (PR9788) llvm-svn: 159336 --- clang/lib/CodeGen/CodeGenModule.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.h') diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index a742d84..d6ff50d 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/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(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(GD.getDecl())) return GetAddrOfCXXConstructor(cast(GD.getDecl()), -- cgit v1.1