mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-14 12:12:07 +00:00
[clang-tidy] Fix doxygen errors. NFC.
llvm-svn: 272994
This commit is contained in:
parent
2150390a2a
commit
c9c8290251
@ -94,11 +94,11 @@ private:
|
||||
/// base class's methods. E.g. to implement a check that validates namespace
|
||||
/// declarations, override ``registerMatchers``:
|
||||
///
|
||||
/// ```c++
|
||||
/// ~~~{.cpp}
|
||||
/// void registerMatchers(ast_matchers::MatchFinder *Finder) override {
|
||||
/// Finder->addMatcher(namespaceDecl().bind("namespace"), this);
|
||||
/// }
|
||||
/// ```
|
||||
/// ~~~
|
||||
///
|
||||
/// and then override ``check(const MatchResult &Result)`` to do the actual
|
||||
/// check for each match.
|
||||
@ -127,7 +127,7 @@ public:
|
||||
/// dependent properties, e.g. the order of include directives.
|
||||
virtual void registerPPCallbacks(CompilerInstance &Compiler) {}
|
||||
|
||||
/// \brief Override this to register ASTMatchers with \p Finder.
|
||||
/// \brief Override this to register AST matchers with \p Finder.
|
||||
///
|
||||
/// This should be used by clang-tidy checks that analyze code properties that
|
||||
/// dependent on AST knowledge.
|
||||
|
@ -20,11 +20,16 @@ namespace modernize {
|
||||
/// alternatives.
|
||||
///
|
||||
/// Before:
|
||||
/// #include <header.h>
|
||||
/// After:
|
||||
/// #include <cheader>
|
||||
/// ~~~{.cpp}
|
||||
/// #include <header.h>
|
||||
/// ~~~
|
||||
///
|
||||
/// Example: <stdio.h> => <cstdio>
|
||||
/// After:
|
||||
/// ~~~{.cpp}
|
||||
/// #include <cheader>
|
||||
/// ~~~
|
||||
///
|
||||
/// Example: ``<stdio.h> => <cstdio>``
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-deprecated-headers.html
|
||||
|
@ -16,8 +16,8 @@ namespace clang {
|
||||
namespace tidy {
|
||||
namespace readability {
|
||||
|
||||
/// Flag statements of the form: delete <unique_ptr expr>.release()
|
||||
/// and replace them with: <unique_ptr expr> = nullptr
|
||||
/// Flags statements of the form ``delete <unique_ptr expr>.release();`` and
|
||||
/// replaces them with: ``<unique_ptr expr> = nullptr;``
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/readability-uniqueptr-delete-release.html
|
||||
|
@ -18,11 +18,12 @@ namespace tidy {
|
||||
namespace utils {
|
||||
namespace decl_ref_expr {
|
||||
|
||||
/// \brief Returns true if all DeclRefExpr to the variable within Stmt do not
|
||||
/// modify it.
|
||||
/// \brief Returns true if all ``DeclRefExpr`` to the variable within ``Stmt``
|
||||
/// do not modify it.
|
||||
///
|
||||
/// Returns true if only const methods or operators are called on the variable
|
||||
/// or the variable is a const reference or value argument to a callExpr().
|
||||
/// Returns ``true`` if only const methods or operators are called on the
|
||||
/// variable or the variable is a const reference or value argument to a
|
||||
/// ``callExpr()``.
|
||||
bool isOnlyUsedAsConst(const VarDecl &Var, const Stmt &Stmt,
|
||||
ASTContext &Context);
|
||||
|
||||
|
@ -18,10 +18,10 @@ namespace tidy {
|
||||
namespace utils {
|
||||
namespace fixit {
|
||||
|
||||
/// \brief Creates fix to make VarDecl a reference by adding '&'.
|
||||
/// \brief Creates fix to make ``VarDecl`` a reference by adding ``&``.
|
||||
FixItHint changeVarDeclToReference(const VarDecl &Var, ASTContext &Context);
|
||||
|
||||
/// \brief Creates fix to make VarDecl const qualified.
|
||||
/// \brief Creates fix to make ``VarDecl`` const qualified.
|
||||
FixItHint changeVarDeclToConst(const VarDecl &Var);
|
||||
|
||||
} // namespace fixit
|
||||
|
@ -21,17 +21,17 @@ namespace utils {
|
||||
|
||||
typedef llvm::SmallSet<llvm::StringRef, 5> HeaderFileExtensionsSet;
|
||||
|
||||
/// \brief Checks whether expansion location of Loc is in header file.
|
||||
/// \brief Checks whether expansion location of \p Loc is in header file.
|
||||
bool isExpansionLocInHeaderFile(
|
||||
SourceLocation Loc, const SourceManager &SM,
|
||||
const HeaderFileExtensionsSet &HeaderFileExtensions);
|
||||
|
||||
/// \brief Checks whether presumed location of Loc is in header file.
|
||||
/// \brief Checks whether presumed location of \p Loc is in header file.
|
||||
bool isPresumedLocInHeaderFile(
|
||||
SourceLocation Loc, SourceManager &SM,
|
||||
const HeaderFileExtensionsSet &HeaderFileExtensions);
|
||||
|
||||
/// \brief Checks whether spelling location of Loc is in header file.
|
||||
/// \brief Checks whether spelling location of \p Loc is in header file.
|
||||
bool isSpellingLocInHeaderFile(
|
||||
SourceLocation Loc, SourceManager &SM,
|
||||
const HeaderFileExtensionsSet &HeaderFileExtensions);
|
||||
|
@ -23,20 +23,20 @@ public:
|
||||
: ClangTidyCheck(Name, Context) {}
|
||||
void registerPPCallbacks(CompilerInstance &Compiler) override;
|
||||
|
||||
/// \brief Returns true if the checker should suggest inserting a trailing
|
||||
/// comment on the #endif of the header guard. It will use the same name as
|
||||
/// returned by getHeaderGuard.
|
||||
/// Returns ``true`` if the check should suggest inserting a trailing comment
|
||||
/// on the ``#endif`` of the header guard. It will use the same name as
|
||||
/// returned by ``HeaderGuardCheck::getHeaderGuard``.
|
||||
virtual bool shouldSuggestEndifComment(StringRef Filename);
|
||||
/// \brief Returns true if the checker should suggest changing an existing
|
||||
/// header guard to the string returned by getHeaderGuard.
|
||||
/// Returns ``true`` if the check should suggest changing an existing header
|
||||
/// guard to the string returned by ``HeaderGuardCheck::getHeaderGuard``.
|
||||
virtual bool shouldFixHeaderGuard(StringRef Filename);
|
||||
/// \brief Returns true if the checker should add a header guard to the file
|
||||
/// Returns ``true`` if the check should add a header guard to the file
|
||||
/// if it has none.
|
||||
virtual bool shouldSuggestToAddHeaderGuard(StringRef Filename);
|
||||
/// \brief Returns a replacement for endif line with a comment mentioning
|
||||
/// \p HeaderGuard. The replacement should start with "endif".
|
||||
/// Returns a replacement for the ``#endif`` line with a comment mentioning
|
||||
/// \p HeaderGuard. The replacement should start with ``endif``.
|
||||
virtual std::string formatEndIf(StringRef HeaderGuard);
|
||||
/// \brief Get the canonical header guard for a file.
|
||||
/// Gets the canonical header guard for a file.
|
||||
virtual std::string getHeaderGuard(StringRef Filename,
|
||||
StringRef OldGuard = StringRef()) = 0;
|
||||
};
|
||||
|
@ -22,40 +22,47 @@ namespace clang {
|
||||
namespace tidy {
|
||||
namespace utils {
|
||||
|
||||
// IncludeInserter can be used by ClangTidyChecks in the following fashion:
|
||||
// class MyCheck : public ClangTidyCheck {
|
||||
// public:
|
||||
// void registerPPCallbacks(CompilerInstance& Compiler) override {
|
||||
// Inserter.reset(new IncludeInserter(&Compiler.getSourceManager(),
|
||||
// &Compiler.getLangOpts()));
|
||||
// Compiler.getPreprocessor().addPPCallbacks(
|
||||
// Inserter->CreatePPCallback());
|
||||
// }
|
||||
//
|
||||
// void registerMatchers(ast_matchers::MatchFinder* Finder) override { ... }
|
||||
//
|
||||
// void check(const ast_matchers::MatchFinder::MatchResult& Result) override {
|
||||
// ...
|
||||
// Inserter->CreateIncludeInsertion(
|
||||
// Result.SourceManager->getMainFileID(), "path/to/Header.h",
|
||||
// /*IsAngled=*/false);
|
||||
// ...
|
||||
// }
|
||||
//
|
||||
// private:
|
||||
// std::unique_ptr<IncludeInserter> Inserter;
|
||||
// };
|
||||
/// \brief Produces fixes to insert specified includes to source files, if not
|
||||
/// yet present.
|
||||
///
|
||||
/// ``IncludeInserter`` can be used by ``ClangTidyCheck`` in the following
|
||||
/// fashion:
|
||||
/// \code
|
||||
/// class MyCheck : public ClangTidyCheck {
|
||||
/// public:
|
||||
/// void registerPPCallbacks(CompilerInstance& Compiler) override {
|
||||
/// Inserter.reset(new IncludeInserter(&Compiler.getSourceManager(),
|
||||
/// &Compiler.getLangOpts()));
|
||||
/// Compiler.getPreprocessor().addPPCallbacks(
|
||||
/// Inserter->CreatePPCallback());
|
||||
/// }
|
||||
///
|
||||
/// void registerMatchers(ast_matchers::MatchFinder* Finder) override { ... }
|
||||
///
|
||||
/// void check(
|
||||
/// const ast_matchers::MatchFinder::MatchResult& Result) override {
|
||||
/// ...
|
||||
/// Inserter->CreateIncludeInsertion(
|
||||
/// Result.SourceManager->getMainFileID(), "path/to/Header.h",
|
||||
/// /*IsAngled=*/false);
|
||||
/// ...
|
||||
/// }
|
||||
///
|
||||
/// private:
|
||||
/// std::unique_ptr<IncludeInserter> Inserter;
|
||||
/// };
|
||||
/// \endcode
|
||||
class IncludeInserter {
|
||||
public:
|
||||
IncludeInserter(const SourceManager &SourceMgr, const LangOptions &LangOpts,
|
||||
IncludeSorter::IncludeStyle Style);
|
||||
~IncludeInserter();
|
||||
|
||||
// Create PPCallbacks for registration with the compiler's preprocessor.
|
||||
/// Create ``PPCallbacks`` for registration with the compiler's preprocessor.
|
||||
std::unique_ptr<PPCallbacks> CreatePPCallbacks();
|
||||
|
||||
// Creates a Header inclusion directive fixit. Returns None on error or
|
||||
// if inclusion directive already exists.
|
||||
/// Creates a \p Header inclusion directive fixit. Returns ``llvm::None`` on
|
||||
/// error or if inclusion directive already exists.
|
||||
llvm::Optional<FixItHint>
|
||||
CreateIncludeInsertion(FileID FileID, llvm::StringRef Header, bool IsAngled);
|
||||
|
||||
|
@ -18,14 +18,14 @@ namespace tidy {
|
||||
namespace utils {
|
||||
namespace type_traits {
|
||||
|
||||
// \brief Returns true If \c Type is expensive to copy.
|
||||
/// Returns `true` if `Type` is expensive to copy.
|
||||
llvm::Optional<bool> isExpensiveToCopy(QualType Type,
|
||||
const ASTContext &Context);
|
||||
|
||||
// \brief Returns true If \c Type is trivially default constructible.
|
||||
/// Returns `true` if `Type` is trivially default constructible.
|
||||
bool isTriviallyDefaultConstructible(QualType Type, const ASTContext &Context);
|
||||
|
||||
// \brief Returns true If \c RecordDecl is trivially default constructible.
|
||||
/// Returns `true` if `RecordDecl` is trivially default constructible.
|
||||
bool recordIsTriviallyDefaultConstructible(const RecordDecl &RecordDecl,
|
||||
const ASTContext &Context);
|
||||
|
||||
|
@ -819,7 +819,7 @@ EXCLUDE_SYMBOLS =
|
||||
# that contain example code fragments that are included (see the \include
|
||||
# command).
|
||||
|
||||
EXAMPLE_PATH = @abs_srcdir@/../examples
|
||||
EXAMPLE_PATH =
|
||||
|
||||
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
||||
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
|
||||
@ -839,7 +839,7 @@ EXAMPLE_RECURSIVE = YES
|
||||
# that contain images that are to be included in the documentation (see the
|
||||
# \image command).
|
||||
|
||||
IMAGE_PATH = @abs_srcdir@/img
|
||||
IMAGE_PATH =
|
||||
|
||||
# The INPUT_FILTER tag can be used to specify a program that doxygen should
|
||||
# invoke to filter for each input file. Doxygen will invoke the filter program
|
||||
@ -1913,7 +1913,8 @@ SEARCH_INCLUDES = YES
|
||||
# preprocessor.
|
||||
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
|
||||
|
||||
INCLUDE_PATH = ../include
|
||||
INCLUDE_PATH = @abs_srcdir@/../../../include \
|
||||
@abs_srcdir@/../../../../../include
|
||||
|
||||
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
|
||||
# patterns (like *.h and *.hpp) to filter out the header-files in the
|
||||
|
Loading…
x
Reference in New Issue
Block a user