From: Ted Kremenek Date: Fri, 27 Mar 2009 02:22:03 +0000 (+0000) Subject: - Fix thinko in implementation of PathDiagnosticLocation::asStmt(). Thanks to X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a11982a01d2a239a5132b1871f2b417de11ab80d;p=clang - 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67812 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Analysis/PathDiagnostic.h b/include/clang/Analysis/PathDiagnostic.h index 9c6752570d..3d828dff47 100644 --- a/include/clang/Analysis/PathDiagnostic.h +++ b/include/clang/Analysis/PathDiagnostic.h @@ -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 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)); }