]> granicus.if.org Git - clang/commit
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)
commit810def84aca2e23a9e028a422820fed0c1b97500
tree5c30a11cf194637a72cb8cb241d80cf866075b37
parentadb43a714e316ac58c03232e53d18cf6483b8252
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232229 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/MicrosoftMangle.cpp
lib/CodeGen/CGCall.cpp
lib/CodeGen/CodeGenTypes.h
lib/CodeGen/MicrosoftCXXABI.cpp
lib/Sema/SemaDecl.cpp
test/CodeGenCXX/dllexport.cpp