[cfe-commits] r67812 - /cfe/trunk/include/clang/Analysis/PathDiagnostic.h

Ted Kremenek kremenek at apple.com
Thu Mar 26 19:22:03 PDT 2009


Author: kremenek
Date: Thu Mar 26 21:22:03 2009
New Revision: 67812

URL: http://llvm.org/viewvc/llvm-project?rev=67812&view=rev
Log:
- Fix thinko in implementation of PathDiagnosticLocation::asStmt(). Thanks to
  Anders Johnsen for pointing this out.
- Have PathDiagnosticControlFlowPiece take PathDiagnosticLocation for the
  arguments to its constructors.

Modified:
    cfe/trunk/include/clang/Analysis/PathDiagnostic.h

Modified: cfe/trunk/include/clang/Analysis/PathDiagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathDiagnostic.h?rev=67812&r1=67811&r2=67812&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathDiagnostic.h (original)
+++ cfe/trunk/include/clang/Analysis/PathDiagnostic.h Thu Mar 26 21:22:03 2009
@@ -67,7 +67,7 @@
     
   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 @@
 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));
     }





More information about the cfe-commits mailing list