summaryrefslogtreecommitdiffstats
path: root/clang/include
diff options
context:
space:
mode:
Diffstat (limited to 'clang/include')
-rw-r--r--clang/include/clang/Frontend/PCHBitCodes.h4
-rw-r--r--clang/include/clang/Frontend/PCHReader.h5
-rw-r--r--clang/include/clang/Sema/Sema.h7
3 files changed, 9 insertions, 7 deletions
diff --git a/clang/include/clang/Frontend/PCHBitCodes.h b/clang/include/clang/Frontend/PCHBitCodes.h
index bce5c287e77..0b7cb211f4c 100644
--- a/clang/include/clang/Frontend/PCHBitCodes.h
+++ b/clang/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/clang/include/clang/Frontend/PCHReader.h b/clang/include/clang/Frontend/PCHReader.h
index 906e3e1b221..5aa90b717fa 100644
--- a/clang/include/clang/Frontend/PCHReader.h
+++ b/clang/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/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index fdf91db8f54..d2b89824a79 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/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);
OpenPOWER on IntegriCloud