Do not perform the analysis based warning if the warnings are ignored

This saves some cycles when compiling with "-w".

(Also fix a potential crash on invalid code for tools that tries to recover from some
errors, because analysis might compute the CFG which crashes if the code contains
invalid declaration. This does not happen normally with because we also don't perform
these analysis if there was an error.)

Differential Revision: https://reviews.llvm.org/D40242

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318900 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed