From 1b3aee7ff9c82c337a2cd2b52863b7feaf5a0648 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Tue, 13 Sep 2016 22:51:42 +0000 Subject: Also don't inline dllimport functions referring to non-dllimport constructors. The AST walker wasn't visiting CXXConstructExprs before. This is a follow-up to r281395. llvm-svn: 281413 --- clang/lib/CodeGen/CodeGenModule.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 085482b..8614a00 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1693,6 +1693,8 @@ namespace { : public RecursiveASTVisitor { bool SafeToInline = true; + bool shouldVisitImplicitCode() const { return true; } + bool VisitVarDecl(VarDecl *VD) { // A thread-local variable cannot be imported. SafeToInline = !VD->getTLSKind(); @@ -1708,6 +1710,10 @@ namespace { SafeToInline = !V->hasGlobalStorage() || V->hasAttr(); return SafeToInline; } + bool VisitCXXConstructExpr(CXXConstructExpr *E) { + SafeToInline = E->getConstructor()->hasAttr(); + return SafeToInline; + } bool VisitCXXDeleteExpr(CXXDeleteExpr *E) { SafeToInline = E->getOperatorDelete()->hasAttr(); return SafeToInline; -- cgit v1.1