MS ABI: Generate default constructor closures
authorDavid Majnemer <david.majnemer@gmail.com>
Fri, 13 Mar 2015 22:36:55 +0000 (22:36 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Fri, 13 Mar 2015 22:36:55 +0000 (22:36 +0000)
commit37fd66e78bc578e07b5b3fa61bb96e1432a2543e
treefc29ae4c6e4b2faa057607414314f6822c8b0f78
parent9370d2784f8dfad6c36cfa6478dc23c168da446d
MS ABI: Generate default constructor closures

The MS ABI utilizes a compiler generated function called the "vector
constructor iterator" to construct arrays of objects with
non-trivial constructors/destructors.  For this to work, the constructor
must follow a specific calling convention.  A thunk must be created if
the default constructor has default arguments, is variadic or is
otherwise incompatible.  This thunk is called the default constructor
closure.

N.B.  Default constructor closures are only generated if the default
constructor is exported because clang itself does not utilize vector
constructor iterators.  Failing to export the default constructor
closure will result in link/load failure if a translation unit compiled
with MSVC is on the import side.

Differential Revision: http://reviews.llvm.org/D8331

llvm-svn: 232229
clang/lib/AST/MicrosoftMangle.cpp
clang/lib/CodeGen/CGCall.cpp
clang/lib/CodeGen/CodeGenTypes.h
clang/lib/CodeGen/MicrosoftCXXABI.cpp
clang/lib/Sema/SemaDecl.cpp
clang/test/CodeGenCXX/dllexport.cpp