summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-07 08:24:59 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-07 08:24:59 +0000
commit82fccd014a4f2e1fcbde11ed1c39c7fc70f28752 (patch)
tree5f295851790b782a5493ec036d49f7b82b050c30 /clang/lib/Sema/SemaDecl.cpp
parente1b3e6292a355dafc4757d7cd2f2e04ca71927fa (diff)
downloadbcm5719-llvm-82fccd014a4f2e1fcbde11ed1c39c7fc70f28752.tar.gz
bcm5719-llvm-82fccd014a4f2e1fcbde11ed1c39c7fc70f28752.zip
Rework how virtual member functions are marked. If a class has no key function, we now wait until the end of the translation unit to mark its virtual member functions as references. This lays the groundwork for fixing PR5557.
llvm-svn: 90752
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index a5314bb075e..bb3f8694250 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -4114,16 +4114,9 @@ Sema::DeclPtrTy Sema::ActOnFinishFunctionBody(DeclPtrTy D, StmtArg BodyArg,
if (!FD->isInvalidDecl())
DiagnoseUnusedParameters(FD->param_begin(), FD->param_end());
- if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(FD)) {
- // C++ [basic.def.odr]p2:
- // [...] A virtual member function is used if it is not pure. [...]
- if (Method->isVirtual() && !Method->isPure())
- MarkDeclarationReferenced(Method->getLocation(), Method);
-
- if (!Method->isInlined())
- MaybeMarkVirtualImplicitMembersReferenced(Method->getLocation(),
- Method);
- }
+ if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(FD))
+ MaybeMarkVirtualMembersReferenced(Method->getLocation(), Method);
+
assert(FD == getCurFunctionDecl() && "Function parsing confused");
} else if (ObjCMethodDecl *MD = dyn_cast_or_null<ObjCMethodDecl>(dcl)) {
assert(MD == getCurMethodDecl() && "Method parsing confused");
OpenPOWER on IntegriCloud