summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2012-06-28 08:01:44 +0000
committerHans Wennborg <hans@hanshq.net>2012-06-28 08:01:44 +0000
commitf60f6af9e84fe7752edb6fa42464778ac8a53e99 (patch)
tree0fc46d3b32bf750669cf8ad484e64d94c8b54447 /clang/lib/CodeGen/CodeGenModule.h
parent608c0b65d78531d1713a02f34a9b876deefb4943 (diff)
downloadbcm5719-llvm-f60f6af9e84fe7752edb6fa42464778ac8a53e99.tar.gz
bcm5719-llvm-f60f6af9e84fe7752edb6fa42464778ac8a53e99.zip
Add -ftls-model command-line flag.
This allows for setting the default TLS model. (PR9788) llvm-svn: 159336
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index a742d846c19..d6ff50d5ad7 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<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()),
OpenPOWER on IntegriCloud