r197643 - Simplify CXXMethodDecl::isVirtual() for __interface case
Dmitri Gribenko
gribozavr at gmail.com
Wed Dec 18 17:58:53 PST 2013
Author: gribozavr
Date: Wed Dec 18 19:58:52 2013
New Revision: 197643
URL: http://llvm.org/viewvc/llvm-project?rev=197643&view=rev
Log:
Simplify CXXMethodDecl::isVirtual() for __interface case
Modified:
cfe/trunk/include/clang/AST/DeclCXX.h
Modified: cfe/trunk/include/clang/AST/DeclCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=197643&r1=197642&r2=197643&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)
+++ cfe/trunk/include/clang/AST/DeclCXX.h Wed Dec 18 19:58:52 2013
@@ -1692,9 +1692,9 @@ public:
CXXMethodDecl *CD =
cast<CXXMethodDecl>(const_cast<CXXMethodDecl*>(this)->getCanonicalDecl());
- // Methods declared in interfaces are automatically (pure) virtual.
- if (CD->isVirtualAsWritten() ||
- (CD->getParent()->isInterface() && CD->isUserProvided()))
+ // Member function is virtual if it is marked explicitly so, or if it is
+ // declared in __interface -- then it is automatically pure virtual.
+ if (CD->isVirtualAsWritten() || CD->isPure())
return true;
return (CD->begin_overridden_methods() != CD->end_overridden_methods());
More information about the cfe-commits
mailing list