diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2013-01-31 03:23:57 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2013-01-31 03:23:57 +0000 |
commit | 995e26b0523ac8e3b6199a509b871b81fa5df6ee (patch) | |
tree | 42600caca2fde2e41f41eb3fc9dfffb575128f2a /lib/Sema/SemaDecl.cpp | |
parent | 869709c06eefd1d756ae4290646d4412103697bd (diff) |
Remove elements from Sema.UndefinedInternals as functions are defined. Also
filter the elements before emitting them into a PCH. No user-visible
functionality change, except that PCH files may be smaller?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174034 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 80543fd532..834041c65c 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -8428,6 +8428,13 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, if (FD) { FD->setBody(Body); + // The only way to be included in UndefinedInternals is if there is an + // ODR-use before the definition. Avoid the expensive map lookup if this + // is the first declaration. + if (FD->getPreviousDecl() != 0 && FD->getPreviousDecl()->isUsed() && + FD->getLinkage() != ExternalLinkage) + UndefinedInternals.erase(FD); + // If the function implicitly returns zero (like 'main') or is naked, // don't complain about missing return statements. if (FD->hasImplicitReturnZero() || FD->hasAttr<NakedAttr>()) |