From 35672e78523162ab292962ce5aec3f512ee5cf8a Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Fri, 13 Aug 2010 18:42:17 +0000 Subject: Change Sema's UnusedStaticFuncs to UnusedFileScopedDecls to allow also keeping track of unused file scoped variables. This is only preparation, currently only static function definitions are tracked, as before. llvm-svn: 111025 --- clang/lib/Frontend/PCHReader.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'clang/lib/Frontend/PCHReader.cpp') diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp index 137c2d768ea..94917707975 100644 --- a/clang/lib/Frontend/PCHReader.cpp +++ b/clang/lib/Frontend/PCHReader.cpp @@ -1637,13 +1637,13 @@ PCHReader::ReadPCHBlock(PerFileData &F) { Record.begin(), Record.end()); break; - case pch::UNUSED_STATIC_FUNCS: + case pch::UNUSED_FILESCOPED_DECLS: // Optimization for the first block. - if (UnusedStaticFuncs.empty()) - UnusedStaticFuncs.swap(Record); + if (UnusedFileScopedDecls.empty()) + UnusedFileScopedDecls.swap(Record); else - UnusedStaticFuncs.insert(UnusedStaticFuncs.end(), - Record.begin(), Record.end()); + UnusedFileScopedDecls.insert(UnusedFileScopedDecls.end(), + Record.begin(), Record.end()); break; case pch::WEAK_UNDECLARED_IDENTIFIERS: @@ -3150,11 +3150,11 @@ void PCHReader::InitializeSema(Sema &S) { SemaObj->TentativeDefinitions.push_back(Var); } - // If there were any unused static functions, deserialize them and add to - // Sema's list of unused static functions. - for (unsigned I = 0, N = UnusedStaticFuncs.size(); I != N; ++I) { - FunctionDecl *FD = cast(GetDecl(UnusedStaticFuncs[I])); - SemaObj->UnusedStaticFuncs.push_back(FD); + // If there were any unused file scoped decls, deserialize them and add to + // Sema's list of unused file scoped decls. + for (unsigned I = 0, N = UnusedFileScopedDecls.size(); I != N; ++I) { + DeclaratorDecl *D = cast(GetDecl(UnusedFileScopedDecls[I])); + SemaObj->UnusedFileScopedDecls.push_back(D); } // If there were any weak undeclared identifiers, deserialize them and add to -- cgit v1.2.3