aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2016-09-13 22:51:42 +0000
committerHans Wennborg <hans@hanshq.net>2016-09-13 22:51:42 +0000
commit1b3aee7ff9c82c337a2cd2b52863b7feaf5a0648 (patch)
treeda6fee3525427668519ca6308398dbae6173f33a /clang/lib/CodeGen/CodeGenModule.cpp
parent45d56c2211c01873712725d331bf7203a11c8622 (diff)
downloadllvm-1b3aee7ff9c82c337a2cd2b52863b7feaf5a0648.zip
llvm-1b3aee7ff9c82c337a2cd2b52863b7feaf5a0648.tar.gz
llvm-1b3aee7ff9c82c337a2cd2b52863b7feaf5a0648.tar.bz2
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp6
1 files changed, 6 insertions, 0 deletions
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<DLLImportFunctionVisitor> {
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<DLLImportAttr>();
return SafeToInline;
}
+ bool VisitCXXConstructExpr(CXXConstructExpr *E) {
+ SafeToInline = E->getConstructor()->hasAttr<DLLImportAttr>();
+ return SafeToInline;
+ }
bool VisitCXXDeleteExpr(CXXDeleteExpr *E) {
SafeToInline = E->getOperatorDelete()->hasAttr<DLLImportAttr>();
return SafeToInline;