aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-09 17:41:13 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-09 17:41:13 +0000
commit47268a3f2843a8d64f3a6fef1e9a9dde1feb4a8c (patch)
tree27de83043d82a323760b13ecabecf18373b0f948 /lib/Sema/Sema.cpp
parent6cd3b9fb8a29bb70fff01719bdde238723d67c10 (diff)
Remove all "used" static functions *after* we have performed all of
the implicit template instantiations we need to perform. Otherwise, we end up erroneously diagnosing static functions as used if they were only used within an implicit template instantiation. Fixes a bunch of spurious failures when building Clang with Clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100872 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r--lib/Sema/Sema.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index ccfbe1e00a..2bb1ed8ce9 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -197,14 +197,7 @@ void Sema::DeleteStmt(StmtTy *S) {
/// ActOnEndOfTranslationUnit - This is called at the very end of the
/// translation unit when EOF is reached and all but the top-level scope is
/// popped.
-void Sema::ActOnEndOfTranslationUnit() {
-
- // Remove functions that turned out to be used.
- UnusedStaticFuncs.erase(std::remove_if(UnusedStaticFuncs.begin(),
- UnusedStaticFuncs.end(),
- std::mem_fun(&FunctionDecl::isUsed)),
- UnusedStaticFuncs.end());
-
+void Sema::ActOnEndOfTranslationUnit() {
while (1) {
// C++: Perform implicit template instantiations.
//
@@ -225,6 +218,12 @@ void Sema::ActOnEndOfTranslationUnit() {
break;
}
+ // Remove functions that turned out to be used.
+ UnusedStaticFuncs.erase(std::remove_if(UnusedStaticFuncs.begin(),
+ UnusedStaticFuncs.end(),
+ std::mem_fun(&FunctionDecl::isUsed)),
+ UnusedStaticFuncs.end());
+
// Check for #pragma weak identifiers that were never declared
// FIXME: This will cause diagnostics to be emitted in a non-determinstic
// order! Iterating over a densemap like this is bad.