]> granicus.if.org Git - clang/commit
[-Wunreachable-code] Don't warn about dead code guarded by a "configuration value".
authorTed Kremenek <kremenek@apple.com>
Wed, 5 Mar 2014 00:01:17 +0000 (00:01 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 5 Mar 2014 00:01:17 +0000 (00:01 +0000)
commit19bab1683aa8d0a9166b734ed67866aa2756371c
tree3baaf6a758e9675d6903beaf6e97a6ea0f9187d4
parent288b33f7afb00418a116215e04567b0d4eb2a01a
[-Wunreachable-code] Don't warn about dead code guarded by a "configuration value".

Some unreachable code is only "sometimes unreachable" because it
is guarded by a configuration value that is determined at compile
time and is always constant.  Sometimes those represent real bugs,
but often they do not.  This patch causes the reachability analysis
to cover such branches even if they are technically unreachable
in the CFG itself.  There are some conservative heuristics at
play here to determine a "configuration value"; these are intended
to be refined over time.

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