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
This commit is contained in:
Richard Smith
2013-04-14 23:01:42 +00:00
parent e45f58d8a9
commit dbf74baee5
9 changed files with 102 additions and 20 deletions

View File

@@ -1627,6 +1627,7 @@ CodeGenModule::MaybeEmitGlobalStdInitializerListInitializer(const VarDecl *D,
D->getLocStart(), D->getLocation(),
name, arrayType, sourceInfo,
SC_Static);
backingArray->setTLSKind(D->getTLSKind());
// Now clone the InitListExpr to initialize the array instead.
// Incredible hack: we want to use the existing InitListExpr here, so we need