[PATCH] D120711: [clang][dataflow] Add flow condition constraints to Environment

Stanislav Gatev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 1 14:40:48 PST 2022


sgatev marked 2 inline comments as done.
sgatev added a comment.

Thanks!



================
Comment at: clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp:43
+
+  auto Res = ConjunctionVals.try_emplace(
+      std::move(Key),
----------------
ymandel wrote:
> xazax.hun wrote:
> > As far as I understand, we need to do the double lookup (`find` and later `try_emplace`) because we do not want to allocate + take ownership when we hit the cache.  An alternative is to first do `try_emplace` with a `nullptr` and overwrite the value if the emplace was successful. But I guess that also can be confusing, so it is up to you which one would you prefer.
> good point. I was thinking of the value case. Sorry.
Makes sense and I think it doesn't look that bad so let's go with it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120711/new/

https://reviews.llvm.org/D120711



More information about the cfe-commits mailing list