]> granicus.if.org Git - clang/commit
[analyzer] Annotate ProgramState update methods with LLVM_NODISCARD.
authorArtem Dergachev <artem.dergachev@gmail.com>
Thu, 31 May 2018 18:30:41 +0000 (18:30 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Thu, 31 May 2018 18:30:41 +0000 (18:30 +0000)
commitfab03239bf29b5d5c1d9ecb7ccd8547d8f4ef659
treebeb3fa5c5da323f2d9b111922061106df5120f31
parent5071484f71967cc46618e663021b7a8e31fa6941
[analyzer] Annotate ProgramState update methods with LLVM_NODISCARD.

Because our program states are immutable, methods like "add<>", "set<>", "bind"
create a copy of the program state instead of mutating the existing state.
If the updated state is discarded, it clearly indicates a bug.
Such bugs are introduced frequently, hence the warn_unused_result annotation.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333679 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h