From a11982a01d2a239a5132b1871f2b417de11ab80d Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 27 Mar 2009 02:22:03 +0000 Subject: [PATCH] - 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 --- include/clang/Analysis/PathDiagnostic.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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)); } -- 2.50.1