Add a 'kind' field to PathDiagnosticPieces.

llvm-svn: 65862
This commit is contained in:
Ted Kremenek 2009-03-02 19:40:38 +00:00
parent 353e40211c
commit da8cdbb53e
1 changed files with 7 additions and 3 deletions

View File

@ -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<CodeModificationHint> CodeModificationHints;
const Kind kind;
const DisplayHint Hint;
std::vector<SourceRange> 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));