]> granicus.if.org Git - clang/commit
Fix recent regressions in -Wreturn-type caused by heuristics to -Wunreachable-code.
authorTed Kremenek <kremenek@apple.com>
Fri, 7 Mar 2014 07:14:36 +0000 (07:14 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 7 Mar 2014 07:14:36 +0000 (07:14 +0000)
commit2bd39692ca0b5b64d00e3f1b36239f83fae0c6f7
treed8c07219627150c27dc441833105f6b248bc4319
parent9f36327e3df8d2a4e89109b86eb610d84a13b4b9
Fix recent regressions in -Wreturn-type caused by heuristics to -Wunreachable-code.

I had forgotten that the same reachability code is used by both -Wreturn-type
and -Wunreachable-code, so the heuristics applied to the latter were indirectly
impacting the former.

To address this, the reachability code is more refactored so that whiled
the logic at its core is shared, the intention of the clients are better
captured and segregated in helper APIs.

Fixes PR19074, and also some false positives reported offline to me
by Nick Lewycky.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203209 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ReachableCode.cpp
test/Sema/return.c