summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/MicrosoftCXXABI.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-03-11 18:36:39 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-03-11 18:36:39 +0000
commitdfa6d2067c8c782c83be69a61fe59a0240535df6 (patch)
tree6223cf5bbe42de63a13b9301deb125b41e56de86 /clang/lib/AST/MicrosoftCXXABI.cpp
parent4320495319466c12543985ff7e653aedf81f8f36 (diff)
downloadbcm5719-llvm-dfa6d2067c8c782c83be69a61fe59a0240535df6.tar.gz
bcm5719-llvm-dfa6d2067c8c782c83be69a61fe59a0240535df6.zip
MS ABI: Implement copy-ctor closures, finish implementing throw
This adds support for copy-constructor closures. These are generated when the C++ runtime has to call a copy-constructor with a particular calling convention or with default arguments substituted in to the call. Because the runtime has no mechanism to call the function with a different calling convention or know-how to evaluate the default arguments at run-time, we create a thunk which will do all the appropriate work and package it in a way the runtime can use. Differential Revision: http://reviews.llvm.org/D8225 llvm-svn: 231952
Diffstat (limited to 'clang/lib/AST/MicrosoftCXXABI.cpp')
-rw-r--r--clang/lib/AST/MicrosoftCXXABI.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/AST/MicrosoftCXXABI.cpp b/clang/lib/AST/MicrosoftCXXABI.cpp
index 71b21bff77c..fb3beff4beb 100644
--- a/clang/lib/AST/MicrosoftCXXABI.cpp
+++ b/clang/lib/AST/MicrosoftCXXABI.cpp
@@ -64,6 +64,8 @@ public:
class MicrosoftCXXABI : public CXXABI {
ASTContext &Context;
llvm::SmallDenseMap<CXXRecordDecl *, CXXConstructorDecl *> RecordToCopyCtor;
+ llvm::SmallDenseMap<std::pair<const CXXConstructorDecl *, unsigned>, Expr *>
+ CtorToDefaultArgExpr;
public:
MicrosoftCXXABI(ASTContext &Ctx) : Context(Ctx) { }
@@ -92,6 +94,16 @@ public:
Layout.getNonVirtualSize() == PointerSize * 2;
}
+ void addDefaultArgExprForConstructor(const CXXConstructorDecl *CD,
+ unsigned ParmIdx, Expr *DAE) override {
+ CtorToDefaultArgExpr[std::make_pair(CD, ParmIdx)] = DAE;
+ }
+
+ Expr *getDefaultArgExprForConstructor(const CXXConstructorDecl *CD,
+ unsigned ParmIdx) override {
+ return CtorToDefaultArgExpr[std::make_pair(CD, ParmIdx)];
+ }
+
const CXXConstructorDecl *
getCopyConstructorForExceptionObject(CXXRecordDecl *RD) override {
return RecordToCopyCtor[RD];
OpenPOWER on IntegriCloud