r181087 - [analyzer; alternate edges] ignore parentheses when determining edge levels.
Ted Kremenek
kremenek at apple.com
Fri May 3 18:13:13 PDT 2013
Author: kremenek
Date: Fri May 3 20:13:12 2013
New Revision: 181087
URL: http://llvm.org/viewvc/llvm-project?rev=181087&view=rev
Log:
[analyzer;alternate edges] ignore parentheses when determining edge levels.
Modified:
cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp?rev=181087&r1=181086&r2=181087&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp Fri May 3 20:13:12 2013
@@ -1747,7 +1747,7 @@ const Stmt *getLocStmt(PathDiagnosticLoc
const Stmt *getStmtParent(const Stmt *S, ParentMap &PM) {
if (!S)
return 0;
- return PM.getParent(S);
+ return PM.getParentIgnoreParens(S);
}
static bool optimizeEdges(PathPieces &path,
@@ -1837,7 +1837,7 @@ static bool optimizeEdges(PathPieces &pa
// (1.1 -> 1.1.1) -> (1.1.1 -> 1.2) becomes (1.1 -> 1.2).
if (level1 && level2 &&
level1 == level4 &&
- level2 == level3 && PM.getParent(level2) == level1) {
+ level2 == level3 && PM.getParentIgnoreParens(level2) == level1) {
PieceI->setEndLocation(PieceNextI->getEndLocation());
path.erase(NextI);
hasChanges = true;
@@ -1856,7 +1856,7 @@ static bool optimizeEdges(PathPieces &pa
//
// (1.1 -> 1.1.1) -> (1.1.1 -> X) becomes (1.1 -> X).
//
- if (level1 && level2 && level1 == PM.getParent(level2)) {
+ if (level1 && level2 && level1 == PM.getParentIgnoreParens(level2)) {
PieceI->setEndLocation(PieceNextI->getEndLocation());
path.erase(NextI);
hasChanges = true;
More information about the cfe-commits
mailing list