PathDiagnostics (analyzer):
- Added a new class, 'PathDiagnosticLocation', that is a variant for
SourceLocation, SourceRange, or Stmt*. This will be used soon by
PathDiagnosticPieces to describe locations for targets of branches, locations
of events, etc.
- Did some prep. refactoring of PathDiagnosticPieces to prepare them for
adopting the new PathDiagnosticLocation
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67767 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/PathDiagnostic.cpp b/lib/Analysis/PathDiagnostic.cpp
index 86b113c..0ccb900 100644
--- a/lib/Analysis/PathDiagnostic.cpp
+++ b/lib/Analysis/PathDiagnostic.cpp
@@ -49,28 +49,16 @@
return s.empty () ? 0 : GetNumCharsToLastNonPeriod(&s[0]);
}
-PathDiagnosticPiece::PathDiagnosticPiece(FullSourceLoc pos,
- const std::string& s,
+PathDiagnosticPiece::PathDiagnosticPiece(const std::string& s,
Kind k, DisplayHint hint)
- : Pos(pos), str(s, 0, GetNumCharsToLastNonPeriod(s)), kind(k), Hint(hint) {
- assert(Pos.isValid() &&
- "PathDiagnosticPiece's must have a valid location.");
-}
+ : str(s, 0, GetNumCharsToLastNonPeriod(s)), kind(k), Hint(hint) {}
-PathDiagnosticPiece::PathDiagnosticPiece(FullSourceLoc pos,
- const char* s, Kind k,
+PathDiagnosticPiece::PathDiagnosticPiece(const char* s, Kind k,
DisplayHint hint)
- : Pos(pos), str(s, GetNumCharsToLastNonPeriod(s)), kind(k), Hint(hint) {
- assert(Pos.isValid() &&
- "PathDiagnosticPiece's must have a valid location.");
-}
+ : str(s, GetNumCharsToLastNonPeriod(s)), kind(k), Hint(hint) {}
-PathDiagnosticPiece::PathDiagnosticPiece(FullSourceLoc pos, Kind k,
- DisplayHint hint)
- : Pos(pos), kind(k), Hint(hint) {
- assert(Pos.isValid() &&
- "PathDiagnosticPiece's must have a valid location.");
-}
+PathDiagnosticPiece::PathDiagnosticPiece(Kind k, DisplayHint hint)
+ : kind(k), Hint(hint) {}
PathDiagnosticPiece::~PathDiagnosticPiece() {}
PathDiagnosticEventPiece::~PathDiagnosticEventPiece() {}