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 /include/clang | |
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 'include/clang')
-rw-r--r-- | include/clang/Frontend/PCHBitCodes.h | 4 | ||||
-rw-r--r-- | include/clang/Frontend/PCHReader.h | 5 | ||||
-rw-r--r-- | include/clang/Sema/Sema.h | 7 |
3 files changed, 9 insertions, 7 deletions
diff --git a/include/clang/Frontend/PCHBitCodes.h b/include/clang/Frontend/PCHBitCodes.h index bce5c287e7..0b7cb211f4 100644 --- a/include/clang/Frontend/PCHBitCodes.h +++ b/include/clang/Frontend/PCHBitCodes.h @@ -221,8 +221,8 @@ namespace clang { /// information of the compiler used to build this PCH file. VERSION_CONTROL_BRANCH_REVISION = 21, - /// \brief Record code for the array of unused static functions. - UNUSED_STATIC_FUNCS = 22, + /// \brief Record code for the array of unused file scoped decls. + UNUSED_FILESCOPED_DECLS = 22, /// \brief Record code for the table of offsets to macro definition /// entries in the preprocessing record. diff --git a/include/clang/Frontend/PCHReader.h b/include/clang/Frontend/PCHReader.h index 906e3e1b22..5aa90b717f 100644 --- a/include/clang/Frontend/PCHReader.h +++ b/include/clang/Frontend/PCHReader.h @@ -381,9 +381,8 @@ private: /// file. llvm::SmallVector<uint64_t, 16> TentativeDefinitions; - /// \brief The set of unused static functions stored in the the PCH - /// file. - llvm::SmallVector<uint64_t, 16> UnusedStaticFuncs; + /// \brief The set of unused file scoped decls stored in the the PCH file. + llvm::SmallVector<uint64_t, 16> UnusedFileScopedDecls; /// \brief The set of weak undeclared identifiers stored in the the PCH file. llvm::SmallVector<uint64_t, 64> WeakUndeclaredIdentifiers; diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index fdf91db8f5..d2b89824a7 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -348,8 +348,9 @@ public: /// \brief All the tentative definitions encountered in the TU. std::vector<VarDecl *> TentativeDefinitions; - /// \brief The set of static functions seen so far that have not been used. - std::vector<FunctionDecl*> UnusedStaticFuncs; + /// \brief The set of file scoped decls seen so far that have not been used + /// and must warn if not used. + std::vector<const DeclaratorDecl*> UnusedFileScopedDecls; class AccessedEntity { public: @@ -1876,6 +1877,8 @@ public: MultiStmtArg Handlers); void DiagnoseReturnInConstructorExceptionHandler(CXXTryStmt *TryBlock); + void MarkUnusedFileScopedDecl(const DeclaratorDecl *D); + /// DiagnoseUnusedExprResult - If the statement passed in is an expression /// whose result is unused, warn. void DiagnoseUnusedExprResult(const Stmt *S); |