summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/MicrosoftMangle.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-03-13 22:36:55 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-03-13 22:36:55 +0000
commit37fd66e78bc578e07b5b3fa61bb96e1432a2543e (patch)
treefc29ae4c6e4b2faa057607414314f6822c8b0f78 /clang/lib/AST/MicrosoftMangle.cpp
parent9370d2784f8dfad6c36cfa6478dc23c168da446d (diff)
downloadbcm5719-llvm-37fd66e78bc578e07b5b3fa61bb96e1432a2543e.tar.gz
bcm5719-llvm-37fd66e78bc578e07b5b3fa61bb96e1432a2543e.zip
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
Diffstat (limited to 'clang/lib/AST/MicrosoftMangle.cpp')
-rw-r--r--clang/lib/AST/MicrosoftMangle.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp
index f56da26a09b..6a0ebda7b33 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/lib/AST/MicrosoftMangle.cpp
@@ -1640,10 +1640,11 @@ void MicrosoftCXXNameMangler::mangleFunctionType(const FunctionType *T,
->getPointeeType(),
/*SpelledAsLValue=*/true),
Range);
+ Out << '@';
} else {
llvm_unreachable("unexpected constructor closure!");
}
- Out << "@Z";
+ Out << 'Z';
return;
}
Out << '@';
OpenPOWER on IntegriCloud