diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2012-02-25 20:51:20 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2012-02-25 20:51:20 +0000 |
commit | 4a7eab25455e68ce928c5fcd7947998118e5cb5c (patch) | |
tree | ca4e084cf67dbad4e1de245e56b849f800ac2b31 /clang/lib/CodeGen/CodeGenModule.h | |
parent | f2e0a3077cf34a537300f34b0457c91f35e40785 (diff) | |
download | llvm-4a7eab25455e68ce928c5fcd7947998118e5cb5c.zip llvm-4a7eab25455e68ce928c5fcd7947998118e5cb5c.tar.gz llvm-4a7eab25455e68ce928c5fcd7947998118e5cb5c.tar.bz2 |
CodeGen support for global variables of type std::initializer_list<X>.
This emits a backing array with internal linkage and fills it with data,
then has the initializer_list point at the array. Dynamic initialization
and global destructors are correctly supported.
What doesn't work is nested initializer_lists. I have no idea how to
get them to work, either. However, these should be very rare, and so
I'll just call it a known bug and declare generalized initializers
DONE!
llvm-svn: 151457
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index fa1830a..8bbee6a2 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -55,6 +55,7 @@ namespace clang { class Decl; class Expr; class Stmt; + class InitListExpr; class StringLiteral; class NamedDecl; class ValueDecl; @@ -877,6 +878,8 @@ private: void EmitGlobalFunctionDefinition(GlobalDecl GD); void EmitGlobalVarDefinition(const VarDecl *D); + llvm::Constant *MaybeEmitGlobalStdInitializerListInitializer(const VarDecl *D, + const Expr *init); void EmitAliasDefinition(GlobalDecl GD); void EmitObjCPropertyImplementations(const ObjCImplementationDecl *D); void EmitObjCIvarInitializations(ObjCImplementationDecl *D); |