From d0feed6224d70ed7b1483342ddef4437b80beef2 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 2 Mar 2009 19:40:38 +0000 Subject: [PATCH] Add a 'kind' field to PathDiagnosticPieces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65862 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Analysis/PathDiagnostic.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/clang/Analysis/PathDiagnostic.h b/include/clang/Analysis/PathDiagnostic.h index a77ff66001..bdfa88b4ad 100644 --- a/include/clang/Analysis/PathDiagnostic.h +++ b/include/clang/Analysis/PathDiagnostic.h @@ -26,30 +26,34 @@ namespace clang { class PathDiagnosticPiece { public: + enum Kind { ControlFlow, Event }; enum DisplayHint { Above, Below }; private: const FullSourceLoc Pos; const std::string str; std::vector CodeModificationHints; + const Kind kind; const DisplayHint Hint; std::vector ranges; public: PathDiagnosticPiece(FullSourceLoc pos, const std::string& s, + Kind k = Event, DisplayHint hint = Above); PathDiagnosticPiece(FullSourceLoc pos, const char* s, + Kind k = Event, DisplayHint hint = Above); const std::string& getString() const { return str; } DisplayHint getDisplayHint() const { return Hint; } - void addRange(SourceRange R) { - ranges.push_back(R); - } + Kind getKind() const { return kind; } + + void addRange(SourceRange R) { ranges.push_back(R); } void addRange(SourceLocation B, SourceLocation E) { ranges.push_back(SourceRange(B,E)); -- 2.40.0