Skip to content

Commit 7da3862

Browse files
steakhalNagyDonat
authored andcommitted
NFC Rename getTagDescription to getDebugName
1 parent 4e8035f commit 7da3862

File tree

9 files changed

+16
-18
lines changed

9 files changed

+16
-18
lines changed

clang/include/clang/Analysis/ProgramPoint.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class ProgramPointTag {
4242

4343
/// The description of this program point which will be dumped for debugging
4444
/// purposes. Do not use in user-facing output!
45-
virtual StringRef getTagDescription() const = 0;
45+
virtual StringRef getDebugName() const = 0;
4646

4747
/// Used to implement 'isKind' in subclasses.
4848
const void *getTagKind() const { return TagKind; }
@@ -55,7 +55,7 @@ class SimpleProgramPointTag : public ProgramPointTag {
5555
std::string Desc;
5656
public:
5757
SimpleProgramPointTag(StringRef MsgProvider, StringRef Msg);
58-
StringRef getTagDescription() const override;
58+
StringRef getDebugName() const override;
5959
};
6060

6161
class ProgramPoint {

clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ class BugReporterContext {
758758
/// DataTag::Factory should be friend for every derived class.
759759
class DataTag : public ProgramPointTag {
760760
public:
761-
StringRef getTagDescription() const override { return "Data Tag"; }
761+
StringRef getDebugName() const override { return "Data Tag"; }
762762

763763
// Manage memory for DataTag objects.
764764
class Factory {
@@ -809,7 +809,7 @@ class NoteTag : public DataTag {
809809
return std::move(Msg);
810810
}
811811

812-
StringRef getTagDescription() const override {
812+
StringRef getDebugName() const override {
813813
// TODO: Remember a few examples of generated messages
814814
// and display them in the ExplodedGraph dump by
815815
// returning them from this function.

clang/include/clang/StaticAnalyzer/Core/Checker.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ class CheckerBase : public CheckerFrontend, public CheckerBackend {
526526
public:
527527
/// Attached to nodes created by this checker class when the ExplodedGraph is
528528
/// dumped for debugging.
529-
StringRef getTagDescription() const override;
529+
StringRef getDebugName() const override;
530530
};
531531

532532
/// Simple checker classes that implement one frontend (i.e. checker name)
@@ -546,7 +546,7 @@ class Checker : public CheckerBase, public CHECKs... {
546546
/// frontends) should derive from this template, specify all the implemented
547547
/// callbacks (i.e. classes like `check::PreStmt` or `eval::Call`) as template
548548
/// arguments of `FamilyChecker` and implement the pure virtual method
549-
/// `StringRef getTagDescription()` which is inherited from `ProgramPointTag`
549+
/// `StringRef getDebugName()` which is inherited from `ProgramPointTag`
550550
/// and should return a string identifying the class for debugging purposes.
551551
template <typename... CHECKs>
552552
class CheckerFamily : public CheckerBackend, public CHECKs... {

clang/lib/Analysis/ProgramPoint.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,4 @@ SimpleProgramPointTag::SimpleProgramPointTag(StringRef MsgProvider,
357357
StringRef Msg)
358358
: Desc((MsgProvider + " : " + Msg).str()) {}
359359

360-
StringRef SimpleProgramPointTag::getTagDescription() const {
361-
return Desc;
362-
}
360+
StringRef SimpleProgramPointTag::getDebugName() const { return Desc; }

clang/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class DivZeroChecker : public CheckerFamily<check::PreStmt<BinaryOperator>> {
4141
void checkPreStmt(const BinaryOperator *B, CheckerContext &C) const;
4242

4343
/// Identifies this checker family for debugging purposes.
44-
StringRef getTagDescription() const override { return "DivZeroChecker"; }
44+
StringRef getDebugName() const override { return "DivZeroChecker"; }
4545
};
4646
} // end anonymous namespace
4747

clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class VirtualCallChecker
5555
void checkPreCall(const CallEvent &Call, CheckerContext &C) const;
5656

5757
/// Identifies this checker family for debugging purposes.
58-
StringRef getTagDescription() const override { return "VirtualCallChecker"; }
58+
StringRef getDebugName() const override { return "VirtualCallChecker"; }
5959

6060
private:
6161
void registerCtorDtorCallInState(bool IsBeginFunction,

clang/lib/StaticAnalyzer/Core/Checker.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ using namespace ento;
1818

1919
int ImplicitNullDerefEvent::Tag;
2020

21-
StringRef CheckerBase::getTagDescription() const { return getName(); }
21+
StringRef CheckerBase::getDebugName() const { return getName(); }
2222

2323
void CheckerBackend::printState(raw_ostream &Out, ProgramStateRef State,
2424
const char *NL, const char *Sep) const {}
@@ -29,4 +29,4 @@ CheckerProgramPointTag::CheckerProgramPointTag(StringRef CheckerName,
2929

3030
CheckerProgramPointTag::CheckerProgramPointTag(const CheckerBase *Checker,
3131
StringRef Msg)
32-
: SimpleProgramPointTag(Checker->getTagDescription(), Msg) {}
32+
: SimpleProgramPointTag(Checker->getDebugName(), Msg) {}

clang/lib/StaticAnalyzer/Core/CheckerManager.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ namespace {
138138
std::string checkerScopeName(StringRef Name, const CheckerBackend *Checker) {
139139
if (!llvm::timeTraceProfilerEnabled())
140140
return "";
141-
StringRef CheckerTag = Checker ? Checker->getTagDescription() : "<unknown>";
141+
StringRef CheckerTag = Checker ? Checker->getDebugName() : "<unknown>";
142142
return (Name + ":" + CheckerTag).str();
143143
}
144144

@@ -721,12 +721,12 @@ void CheckerManager::runCheckersForEvalCall(ExplodedNodeSet &Dst,
721721
"while the {2} checker also tried to evaluate the same call. At "
722722
"most one checker supposed to evaluate a call.",
723723
toString(Call), evaluatorChecker,
724-
EvalCallChecker.Checker->getTagDescription());
724+
EvalCallChecker.Checker->getDebugName());
725725
llvm_unreachable(AssertionMessage.c_str());
726726
}
727727
#endif
728728
if (evaluated) {
729-
evaluatorChecker = EvalCallChecker.Checker->getTagDescription();
729+
evaluatorChecker = EvalCallChecker.Checker->getDebugName();
730730
Dst.insert(checkDst);
731731
#ifdef NDEBUG
732732
break; // on release don't check that no other checker also evals.
@@ -798,7 +798,7 @@ void CheckerManager::runCheckersForPrintStateJson(raw_ostream &Out,
798798
continue;
799799

800800
Indent(Out, Space, IsDot)
801-
<< "{ \"checker\": \"" << CT.second->getTagDescription()
801+
<< "{ \"checker\": \"" << CT.second->getDebugName()
802802
<< "\", \"messages\": [" << NL;
803803
Indent(Out, InnerSpace, IsDot)
804804
<< '\"' << TempBuf.str().trim() << '\"' << NL;

clang/lib/StaticAnalyzer/Core/ExprEngine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3992,7 +3992,7 @@ struct DOTGraphTraits<ExplodedGraph*> : public DefaultDOTGraphTraits {
39923992
OtherNode->getLocation().printJson(Out, /*NL=*/"\\l");
39933993
Out << ", \"tag\": ";
39943994
if (const ProgramPointTag *Tag = OtherNode->getLocation().getTag())
3995-
Out << '\"' << Tag->getTagDescription() << '\"';
3995+
Out << '\"' << Tag->getDebugName() << '\"';
39963996
else
39973997
Out << "null";
39983998
Out << ", \"node_id\": " << OtherNode->getID() <<

0 commit comments

Comments
 (0)