summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
diff options
context:
space:
mode:
authorKristof Umann <kristof.umann@ericsson.com>2019-09-12 19:09:24 +0000
committerKristof Umann <kristof.umann@ericsson.com>2019-09-12 19:09:24 +0000
commit72649423c043341c770516cd73aecde281730260 (patch)
tree9dc15e1f887b38ebfb964737cba930ec5e80c141 /clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
parent456bfdf5154b05b3b7aefbe8bd360d673feb6a82 (diff)
downloadbcm5719-llvm-72649423c043341c770516cd73aecde281730260.tar.gz
bcm5719-llvm-72649423c043341c770516cd73aecde281730260.zip
[analyzer][NFC] Fix inconsistent references to checkers as "checks"
Traditionally, clang-tidy uses the term check, and the analyzer uses checker, but in the very early years, this wasn't the case, and code originating from the early 2010's still incorrectly refer to checkers as checks. This patch attempts to hunt down most of these, aiming to refer to checkers as checkers, but preserve references to callback functions (like checkPreCall) as checks. Differential Revision: https://reviews.llvm.org/D67140 llvm-svn: 371760
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
index 6d105fec4ef..190ab7e21db 100644
--- a/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
+++ b/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
@@ -242,7 +242,7 @@ static json::Object createResult(const PathDiagnostic &Diag,
const PathPieces &Path = Diag.path.flatten(false);
const SourceManager &SMgr = Path.front()->getLocation().getManager();
- auto Iter = RuleMapping.find(Diag.getCheckName());
+ auto Iter = RuleMapping.find(Diag.getCheckerName());
assert(Iter != RuleMapping.end() && "Rule ID is not in the array index map?");
return json::Object{
@@ -254,7 +254,7 @@ static json::Object createResult(const PathDiagnostic &Diag,
*Diag.getLocation().asLocation().getExpansionLoc().getFileEntry(),
SMgr, Artifacts))}},
{"ruleIndex", Iter->getValue()},
- {"ruleId", Diag.getCheckName()}};
+ {"ruleId", Diag.getCheckerName()}};
}
static StringRef getRuleDescription(StringRef CheckName) {
@@ -280,7 +280,7 @@ static StringRef getRuleHelpURIStr(StringRef CheckName) {
}
static json::Object createRule(const PathDiagnostic &Diag) {
- StringRef CheckName = Diag.getCheckName();
+ StringRef CheckName = Diag.getCheckerName();
json::Object Ret{
{"fullDescription", createMessage(getRuleDescription(CheckName))},
{"name", CheckName},
@@ -299,7 +299,7 @@ static json::Array createRules(std::vector<const PathDiagnostic *> &Diags,
llvm::StringSet<> Seen;
llvm::for_each(Diags, [&](const PathDiagnostic *D) {
- StringRef RuleID = D->getCheckName();
+ StringRef RuleID = D->getCheckerName();
std::pair<llvm::StringSet<>::iterator, bool> P = Seen.insert(RuleID);
if (P.second) {
RuleMapping[RuleID] = Rules.size(); // Maps RuleID to an Array Index.
OpenPOWER on IntegriCloud