clang-tools 24.0.0git
clang::tidy::portability::AvoidPragmaCommentCheck Class Reference

Finds uses of #pragma comment and for lib or linker comments suggests using the build system for improved portability. More...

#include <AvoidPragmaCommentCheck.h>

Inheritance diagram for clang::tidy::portability::AvoidPragmaCommentCheck:
[legend]

Public Member Functions

 AvoidPragmaCommentCheck (StringRef Name, ClangTidyContext *Context)
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override

Detailed Description

Finds uses of #pragma comment and for lib or linker comments suggests using the build system for improved portability.

Only the "lib" pragma comment type is implemented on Linux, the rest are Windows-only and should be caught by "-Wunknown-pragmas" on Linux.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/portability/avoid-pragma-comment.html

Definition at line 24 of file AvoidPragmaCommentCheck.h.

Constructor & Destructor Documentation

◆ AvoidPragmaCommentCheck()

clang::tidy::portability::AvoidPragmaCommentCheck::AvoidPragmaCommentCheck ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 26 of file AvoidPragmaCommentCheck.h.

Member Function Documentation

◆ check()

void clang::tidy::portability::AvoidPragmaCommentCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

Definition at line 27 of file AvoidPragmaCommentCheck.cpp.

◆ isLanguageVersionSupported()

bool clang::tidy::portability::AvoidPragmaCommentCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
inlineoverride

Definition at line 30 of file AvoidPragmaCommentCheck.h.

◆ registerMatchers()

void clang::tidy::portability::AvoidPragmaCommentCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

The documentation for this class was generated from the following files: