[clang-tools-extra] 9b16c62 - [clangd] Respect clang-tidy SystemHeaders option if specified
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 11 09:04:51 PST 2023
Author: Sam McCall
Date: 2023-01-11T18:04:42+01:00
New Revision: 9b16c624edde50e2a460f9bd0d2e9ac3cb1af695
URL: https://github.com/llvm/llvm-project/commit/9b16c624edde50e2a460f9bd0d2e9ac3cb1af695
DIFF: https://github.com/llvm/llvm-project/commit/9b16c624edde50e2a460f9bd0d2e9ac3cb1af695.diff
LOG: [clangd] Respect clang-tidy SystemHeaders option if specified
(Previous commit assumed it was always off, which is the default)
Added:
Modified:
clang-tools-extra/clangd/ParsedAST.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/ParsedAST.cpp b/clang-tools-extra/clangd/ParsedAST.cpp
index 637cadaf86c64..d10da8cf28552 100644
--- a/clang-tools-extra/clangd/ParsedAST.cpp
+++ b/clang-tools-extra/clangd/ParsedAST.cpp
@@ -542,8 +542,8 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs,
// NOLINT comments)?
return DiagnosticsEngine::Ignored;
}
- // Match behavior for clang-tidy --system-headers=0 (the default).
- if (Info.hasSourceManager() &&
+ if (!CTContext->getOptions().SystemHeaders.value_or(false) &&
+ Info.hasSourceManager() &&
Info.getSourceManager().isInSystemMacro(Info.getLocation()))
return DiagnosticsEngine::Ignored;
More information about the cfe-commits
mailing list