diff options
author | Gabor Horvath <xazax.hun@gmail.com> | 2017-10-30 12:02:23 +0000 |
---|---|---|
committer | Gabor Horvath <xazax.hun@gmail.com> | 2017-10-30 12:02:23 +0000 |
commit | 3bd24f9440b62523577f790993c55f6bd8700fe0 (patch) | |
tree | 98139a8dac9501e62bb55eae7941c24f154fa318 /clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp | |
parent | f94da596a7b410ef6915cffd7104e832bebb477b (diff) | |
download | bcm5719-llvm-3bd24f9440b62523577f790993c55f6bd8700fe0.tar.gz bcm5719-llvm-3bd24f9440b62523577f790993c55f6bd8700fe0.zip |
[analyzer] Make issue hash related tests more concise
Extend ExprInspection checker to make it possible to dump the issue hash of
arbitrary expressions. This change makes it possible to make issue hash related
tests more concise and also makes debugging issue hash related problems easier.
Differential Revision: https://reviews.llvm.org/D38844
llvm-svn: 316899
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp b/clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp index 2eef1688d4c..810a33ed404 100644 --- a/clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp @@ -16,7 +16,6 @@ #include "clang/Analysis/Analyses/LiveVariables.h" #include "clang/Analysis/CallGraph.h" #include "clang/StaticAnalyzer/Core/Checker.h" -#include "clang/StaticAnalyzer/Core/IssueHash.h" #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h" #include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" @@ -213,35 +212,3 @@ void ento::registerExplodedGraphViewer(CheckerManager &mgr) { mgr.registerChecker<ExplodedGraphViewer>(); } -//===----------------------------------------------------------------------===// -// DumpBugHash -//===----------------------------------------------------------------------===// - -namespace { -class BugHashDumper : public Checker<check::PostStmt<Stmt>> { -public: - mutable std::unique_ptr<BugType> BT; - - void checkPostStmt(const Stmt *S, CheckerContext &C) const { - if (!BT) - BT.reset(new BugType(this, "Dump hash components", "debug")); - - ExplodedNode *N = C.generateNonFatalErrorNode(); - if (!N) - return; - - const LangOptions &Opts = C.getLangOpts(); - const SourceManager &SM = C.getSourceManager(); - FullSourceLoc FL(S->getLocStart(), SM); - std::string HashContent = - GetIssueString(SM, FL, getCheckName().getName(), BT->getCategory(), - C.getLocationContext()->getDecl(), Opts); - - C.emitReport(llvm::make_unique<BugReport>(*BT, HashContent, N)); - } -}; -} - -void ento::registerBugHashDumper(CheckerManager &mgr) { - mgr.registerChecker<BugHashDumper>(); -} |