]> granicus.if.org Git - clang/commitdiff
[analyzer;alternate edges] ignore parentheses when determining edge levels.
authorTed Kremenek <kremenek@apple.com>
Sat, 4 May 2013 01:13:12 +0000 (01:13 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 4 May 2013 01:13:12 +0000 (01:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181087 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/BugReporter.cpp

index 759503a688b004b7370127a8be4b5bef7850679c..c198db29926048931e615a92b7d1b886ecea8cc2 100644 (file)
@@ -1747,7 +1747,7 @@ const Stmt *getLocStmt(PathDiagnosticLocation L) {
 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 &path,
     // (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 &path,
     //
     // (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;