[all-commits] [llvm/llvm-project] b985b6: [clang-tidy] Ignore macros defined within declarat...
Richard Thomson via All-commits
all-commits at lists.llvm.org
Fri Apr 22 16:47:13 PDT 2022
Author: Richard <legalize at xmission.com>
Date: 2022-04-22 (Fri, 22 Apr 2022)
[clang-tidy] Ignore macros defined within declarations
Modernize-macro-to-enum shouldn't try to convert macros to enums
when they are defined inside a declaration or definition, only
when the macros are defined at the top level. Since preprocessing
is disconnected from AST traversal, match nodes in the AST and then
invalidate source ranges spanning AST nodes before issuing diagnostics.
ClangTidyCheck::onEndOfTranslationUnit is called before
PPCallbacks::EndOfMainFile, so defer final diagnostics to the
Differential Revision: https://reviews.llvm.org/D124066
More information about the All-commits