[PATCH] D126560: [analyzer] Track assume call stack to detect fixpoint
Gabor Marton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 2 05:18:27 PDT 2022
martong marked 4 inline comments as done.
martong added a comment.
> Consequently, a SmallPtrSet with 4 as the small buffer size would be better than the SmallVector
Ahh, SmallVector is still better, because with the set we need to do a search in the `erase, which compares badly to a simple decrement in the vector's pop_back.
================
Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h:21
#include "llvm/ADT/Optional.h"
+#include "llvm/ADT/SmallSet.h"
#include "llvm/Support/SaveAndRestore.h"
----------------
steakhal wrote:
> Unused.
Thx.
================
Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h:154
+ bool contains(const ProgramState *S) const {
+ return llvm::find(Aux, S) != Aux.end();
+ }
----------------
steakhal wrote:
> Use `llvm::is_contained()` instead.
Ok.
================
Comment at: clang/lib/StaticAnalyzer/Core/ConstraintManager.cpp:60
+ AssumeStack.push(RawSt);
+ auto AssumeStackBuilder =
+ llvm::make_scope_exit([this]() { AssumeStack.pop(); });
----------------
steakhal wrote:
> Don't we call these 'Guards'?
Yeah, we tend to call them guards in the context of exception safety and resource management. But, I think, "builder" is more expressive here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126560/new/
https://reviews.llvm.org/D126560
More information about the cfe-commits
mailing list