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 | 35672e78523162ab292962ce5aec3f512ee5cf8a (patch) | |
| tree | 3fc477ff544140ebd4fe96a5b0fa46005c823a99 /clang/lib/Frontend/PCHReader.cpp | |
| parent | 5cd66587988e8fc858ca1c32f7cb295966fd824d (diff) | |
| download | bcm5719-llvm-35672e78523162ab292962ce5aec3f512ee5cf8a.tar.gz bcm5719-llvm-35672e78523162ab292962ce5aec3f512ee5cf8a.zip | |
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
Diffstat (limited to 'clang/lib/Frontend/PCHReader.cpp')
| -rw-r--r-- | clang/lib/Frontend/PCHReader.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
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<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 |

