diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-08-13 18:42:17 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-08-13 18:42:17 +0000 |
commit | 49b96d1a382ae9f31456166f1a734d3f7f30b992 (patch) | |
tree | bb2d3d611d5aeb0efc82ca470524fe844aa497d6 /lib/Frontend/PCHReader.cpp | |
parent | f759b4dc74fe8b0cc6e1350b860676ac9b853371 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111025 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index 137c2d768e..9491770797 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/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<FunctionDecl>(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<DeclaratorDecl>(GetDecl(UnusedFileScopedDecls[I])); + SemaObj->UnusedFileScopedDecls.push_back(D); } // If there were any weak undeclared identifiers, deserialize them and add to |