]> granicus.if.org Git - clang/commitdiff
- Fix thinko in implementation of PathDiagnosticLocation::asStmt(). Thanks to
authorTed Kremenek <kremenek@apple.com>
Fri, 27 Mar 2009 02:22:03 +0000 (02:22 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 27 Mar 2009 02:22:03 +0000 (02:22 +0000)
  Anders Johnsen for pointing this out.
- Have PathDiagnosticControlFlowPiece take PathDiagnosticLocation for the
  arguments to its constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67812 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathDiagnostic.h

index 9c6752570df352a740404284db1d1d2a6f7cee6b..3d828dff4778f0a7debb732109e4059da84d71e4 100644 (file)
@@ -67,7 +67,7 @@ public:
     
   FullSourceLoc asLocation() const;
   SourceRange asRange() const;
-  const Stmt *asStmt() const { return S ? S : 0; }
+  const Stmt *asStmt() const { return S; }
 };
 
 class PathDiagnosticLocationPair {
@@ -316,19 +316,22 @@ public:
 class PathDiagnosticControlFlowPiece : public PathDiagnosticPiece {
   std::vector<PathDiagnosticLocationPair> LPairs;
 public:
-  PathDiagnosticControlFlowPiece(FullSourceLoc startPos, FullSourceLoc endPos,
+  PathDiagnosticControlFlowPiece(const PathDiagnosticLocation &startPos,
+                                 const PathDiagnosticLocation &endPos,
                                  const std::string& s)
     : PathDiagnosticPiece(s, ControlFlow) {
       LPairs.push_back(PathDiagnosticLocationPair(startPos, endPos));
     }
   
-  PathDiagnosticControlFlowPiece(FullSourceLoc startPos, FullSourceLoc endPos,
+  PathDiagnosticControlFlowPiece(const PathDiagnosticLocation &startPos,
+                                 const PathDiagnosticLocation &endPos,
                                  const char* s)
     : PathDiagnosticPiece(s, ControlFlow) {
       LPairs.push_back(PathDiagnosticLocationPair(startPos, endPos));
     }
   
-  PathDiagnosticControlFlowPiece(FullSourceLoc startPos, FullSourceLoc endPos)
+  PathDiagnosticControlFlowPiece(const PathDiagnosticLocation &startPos,
+                                 const PathDiagnosticLocation &endPos)
     : PathDiagnosticPiece(ControlFlow) {
       LPairs.push_back(PathDiagnosticLocationPair(startPos, endPos));
     }