[all-commits] [llvm/llvm-project] 4cc7c7: [NFC][analyzer] Remove NodeBuilders in ObjC logic ...
Donát Nagy via All-commits
all-commits at lists.llvm.org
Fri Jun 26 05:53:00 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4cc7c70be0132826fdb3cd6a6c90c2610cc1da9d
https://github.com/llvm/llvm-project/commit/4cc7c70be0132826fdb3cd6a6c90c2610cc1da9d
Author: Donát Nagy <donat.nagy at ericsson.com>
Date: 2026-06-26 (Fri, 26 Jun 2026)
Changed paths:
M clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
M clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp
Log Message:
-----------
[NFC][analyzer] Remove NodeBuilders in ObjC logic (#202709)
This change removes the remaining `NodeBuilder`s from
`ExprEngineObjC.cpp` as a step of my project to gradually replace the
class `NodeBuilder` with more straightforward tools.
The `NodeBuilder`s that I remove were all used in very simple patterns,
especially the two `NodeBuilder`s in `VisitObjCMessage` where the
`Frontier` set is thrown away and the code continues with the return
value of `generateNode` (which is exactly the same as the return value
of the appropriate `makeNode` call).
In addition to the removal of the `NodeBuilder`s, this change also
includes two additional NFC improvements:
1. `populateObjCForDestinationSet` was previously a static helper
function with nine (!) awkward arguments; this change turns it into a
method of `ExprEngine` with only five arguments (and the first three
arguments are customary: _expression_, `Pred`, `Dst` as in the transfer
functions). This change was necessary for the `NodeBuilder` removal:
without this cleanup I would have had to add a tenth argument.
2. In `VisitObjCMessage` I remove two complex and pointless assertions.
The ancestor of these was a simple and useful
```c++
Pred = Bldr.generateNode(currStmt, Pred, notNilState);
assert(Pred && "Should have cached out already!");
```
introduced in 2012 by 5481cfefa63624c4a91da0e05a1140e29ce6f65a in a
checker, but since then it was relocated to the engine, duplicated and
weakened to `assert(Pred || HasTag)`.
As `HasTag` can easily be true and is independent of everything else in
this function, the current assertions (which are removed in this change)
don't provide any helpful invariant, they just state that "`Pred` is not
null ... except when it is null".
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list