summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDeclCXX.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-04-14 23:01:42 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-04-14 23:01:42 +0000
commitdbf74baee576ba200009bcead0117cc641d39071 (patch)
tree98577d678a6974765c016c31024abc4ee444b2d8 /clang/lib/CodeGen/CGDeclCXX.cpp
parente45f58d8a90c2e9fbf4cf46dcf29f27e0deb3077 (diff)
downloadbcm5719-llvm-dbf74baee576ba200009bcead0117cc641d39071.tar.gz
bcm5719-llvm-dbf74baee576ba200009bcead0117cc641d39071.zip
CodeGen support for function-local static thread_local variables with
non-constant constructors or non-trivial destructors. Plus bugfixes for thread_local references bound to temporaries (the temporaries themselves are lifetime-extended to become thread_local), and the corresponding case for std::initializer_list. llvm-svn: 179496
Diffstat (limited to 'clang/lib/CodeGen/CGDeclCXX.cpp')
-rw-r--r--clang/lib/CodeGen/CGDeclCXX.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGDeclCXX.cpp b/clang/lib/CodeGen/CGDeclCXX.cpp
index 609f6aa7c6e..fd766bf3deb 100644
--- a/clang/lib/CodeGen/CGDeclCXX.cpp
+++ b/clang/lib/CodeGen/CGDeclCXX.cpp
@@ -80,6 +80,7 @@ static void EmitDeclDestroy(CodeGenFunction &CGF, const VarDecl &D,
case QualType::DK_objc_strong_lifetime:
case QualType::DK_objc_weak_lifetime:
// We don't care about releasing objects during process teardown.
+ assert(!D.getTLSKind() && "should have rejected this");
return;
}
@@ -105,7 +106,7 @@ static void EmitDeclDestroy(CodeGenFunction &CGF, const VarDecl &D,
argument = llvm::Constant::getNullValue(CGF.Int8PtrTy);
}
- CGM.getCXXABI().registerGlobalDtor(CGF, function, argument);
+ CGM.getCXXABI().registerGlobalDtor(CGF, D, function, argument);
}
/// Emit code to cause the variable at the given address to be considered as
@@ -218,9 +219,6 @@ void CodeGenFunction::EmitCXXGuardedInit(const VarDecl &D,
"this initialization requires a guard variable, which "
"the kernel does not support");
- if (D.getTLSKind())
- CGM.ErrorUnsupported(D.getInit(), "dynamic TLS initialization");
-
CGM.getCXXABI().EmitGuardedInit(*this, D, DeclPtr, PerformInit);
}
OpenPOWER on IntegriCloud