[clang] [clang][analyzer] Simplify code of StreamChecker (NFC). (PR #79312)
Ben Shi via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 26 17:45:39 PST 2024
benshi001 wrote:
I do not like too long lambda either. In my opinion lambda should be short/compact.
And I do not think the redundancy is serious, except the common part
```
ProgramStateRef State = C.getState();
SymbolRef StreamSym = getStreamArg(Desc, Call).getAsSymbol();
if (!StreamSym)
return;
const CallExpr *CE = dyn_cast_or_null<CallExpr>(Call.getOriginExpr());
if (!CE)
return;
const StreamState *OldSS = State->get<StreamMap>(StreamSym);
if (!OldSS)
return;
assertStreamStateOpened(OldSS);
```
which appears in the beginning of most `evalXX` functions. And can we replace this piece with a macro ?
https://github.com/llvm/llvm-project/pull/79312
More information about the cfe-commits
mailing list