aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/PathDiagnostic.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-03-26 21:21:35 +0000
committerTed Kremenek <kremenek@apple.com>2009-03-26 21:21:35 +0000
commit1f9bd0fbf5894b41bba5f2fdb0c6546a7a6ef3d8 (patch)
tree6c22c94cfa805cb3f57545b5f6250b8244669a58 /lib/Analysis/PathDiagnostic.cpp
parentdbf15cb5709067b3d23b3cdd8d014610ba4a8783 (diff)
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
Diffstat (limited to 'lib/Analysis/PathDiagnostic.cpp')
-rw-r--r--lib/Analysis/PathDiagnostic.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/lib/Analysis/PathDiagnostic.cpp b/lib/Analysis/PathDiagnostic.cpp
index 86b113cf87..0ccb900645 100644
--- a/lib/Analysis/PathDiagnostic.cpp
+++ b/lib/Analysis/PathDiagnostic.cpp
@@ -49,28 +49,16 @@ static inline size_t GetNumCharsToLastNonPeriod(const std::string &s) {
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() {}