]> granicus.if.org Git - clang/commit
Add some more asserts to clearly indicate that there are special cases
authorChandler Carruth <chandlerc@gmail.com>
Fri, 4 Nov 2016 06:32:57 +0000 (06:32 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 4 Nov 2016 06:32:57 +0000 (06:32 +0000)
commit9f2f7dc2779045f7e8ca9d9e4a5f413cdcfff7f8
tree02b1274ee9b502b0050b875f0544e1ca9b8ee824
parent98cebfb1cf44e2aedf63e8f856cb08fc6ebc6855
Add some more asserts to clearly indicate that there are special cases
which guarantee pointers are not null. These all seem to have useful
properties and correlations to document, in one case we even had it in
a comment but now it will also be an assert.

This should prevent PVS-Studio from incorrectly claiming that there are
a bunch of potential bugs here. But I feel really strongly that the
PVS-Studio warnings that pointed at this code have a far too high
false-positive rate to be entirely useful. These are just places where
there did seem to be a useful invariant to document and verify with an
assert. Several other places in the code were already correct and
already have perfectly clear code documenting and validating their
invariants, but still ran afoul of PVS-Studio.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285985 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/Expr.cpp
lib/Basic/IdentifierTable.cpp
lib/Lex/HeaderSearch.cpp