summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2014-08-23 21:10:39 +0000
committerHans Wennborg <hans@hanshq.net>2014-08-23 21:10:39 +0000
commit2f9e293e37922ceba3ee6e07e220db91a2f3b0d2 (patch)
tree534176030055ca380f40cc9c3e690fae33af851a /clang/lib/Sema/SemaDeclCXX.cpp
parentad7c910ecf1e969b3a0d5a995b64d6b2715508b1 (diff)
downloadbcm5719-llvm-2f9e293e37922ceba3ee6e07e220db91a2f3b0d2.tar.gz
bcm5719-llvm-2f9e293e37922ceba3ee6e07e220db91a2f3b0d2.zip
checkDLLAttribute: remove a redundant dyn_cast
The same dyn_cast was done earlier in the function. No functionality change. llvm-svn: 216326
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp40
1 files changed, 19 insertions, 21 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index ffec44243af..844011880e4 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -4471,29 +4471,27 @@ static void checkDLLAttribute(Sema &S, CXXRecordDecl *Class) {
Member->addAttr(NewAttr);
}
- if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(Member)) {
- if (ClassExported) {
- if (MD->isUserProvided()) {
- // Instantiate non-default methods..
+ if (MD && ClassExported) {
+ if (MD->isUserProvided()) {
+ // Instantiate non-default methods..
- // .. except for certain kinds of template specializations.
- if (TSK == TSK_ExplicitInstantiationDeclaration)
- continue;
- if (TSK == TSK_ImplicitInstantiation && !ClassAttr->isInherited())
- continue;
+ // .. except for certain kinds of template specializations.
+ if (TSK == TSK_ExplicitInstantiationDeclaration)
+ continue;
+ if (TSK == TSK_ImplicitInstantiation && !ClassAttr->isInherited())
+ continue;
- S.MarkFunctionReferenced(Class->getLocation(), MD);
- } else if (!MD->isTrivial() || MD->isExplicitlyDefaulted() ||
- MD->isCopyAssignmentOperator() ||
- MD->isMoveAssignmentOperator()) {
- // Instantiate non-trivial or explicitly defaulted methods, and the
- // copy assignment / move assignment operators.
- S.MarkFunctionReferenced(Class->getLocation(), MD);
- // Resolve its exception specification; CodeGen needs it.
- auto *FPT = MD->getType()->getAs<FunctionProtoType>();
- S.ResolveExceptionSpec(Class->getLocation(), FPT);
- S.ActOnFinishInlineMethodDef(MD);
- }
+ S.MarkFunctionReferenced(Class->getLocation(), MD);
+ } else if (!MD->isTrivial() || MD->isExplicitlyDefaulted() ||
+ MD->isCopyAssignmentOperator() ||
+ MD->isMoveAssignmentOperator()) {
+ // Instantiate non-trivial or explicitly defaulted methods, and the
+ // copy assignment / move assignment operators.
+ S.MarkFunctionReferenced(Class->getLocation(), MD);
+ // Resolve its exception specification; CodeGen needs it.
+ auto *FPT = MD->getType()->getAs<FunctionProtoType>();
+ S.ResolveExceptionSpec(Class->getLocation(), FPT);
+ S.ActOnFinishInlineMethodDef(MD);
}
}
}
OpenPOWER on IntegriCloud