summaryrefslogtreecommitdiffstats
path: root/clang/lib
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
commit3d46b1cfb401d7df637fea7ede9024720802ccbf (patch)
tree5f794899567042e2933e924a54fde4aac66096d8 /clang/lib
parentdac14a7159c33e8ca27970b0a9ad004f0bfcdb66 (diff)
downloadbcm5719-llvm-3d46b1cfb401d7df637fea7ede9024720802ccbf.tar.gz
bcm5719-llvm-3d46b1cfb401d7df637fea7ede9024720802ccbf.zip
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 llvm-svn: 67767
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Analysis/PathDiagnostic.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/clang/lib/Analysis/PathDiagnostic.cpp b/clang/lib/Analysis/PathDiagnostic.cpp
index 86b113cf873..0ccb9006451 100644
--- a/clang/lib/Analysis/PathDiagnostic.cpp
+++ b/clang/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() {}
OpenPOWER on IntegriCloud