diff options
author | Ted Kremenek <kremenek@apple.com> | 2013-05-04 01:13:05 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2013-05-04 01:13:05 +0000 |
commit | b9e13d555fc9f3e5515e2b1fa6f720e6f10bb076 (patch) | |
tree | 0ac3aa7ea199e89c176bd67a603b4568ca6df7dd /lib/StaticAnalyzer/Core/BugReporter.cpp | |
parent | bb521b8f14ca29ee4e17ae1f9877586ef0bf8378 (diff) |
[analyzer; alternate edges] - merge control edges where we descend to a subexpression and pop back out.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181085 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/BugReporter.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/BugReporter.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index b3c0dac964..827bf09b05 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -1802,6 +1802,26 @@ static bool optimizeEdges(PathPieces &path, hasChanges = true; continue; } + + // Rule II. + // + // If we have two consecutive control edges where we decend to a + // subexpression and then pop out merge them. + // + // NOTE: this will be limited later in cases where we add barriers + // to prevent this optimization. + // + // For example: + // + // (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) { + PieceI->setEndLocation(PieceNextI->getEndLocation()); + path.erase(NextI); + hasChanges = true; + continue; + } } // No changes. |