ymandel marked 2 inline comments as done.
ymandel added inline comments.

================
Comment at: 
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:524
 
-void transferSwap(const StorageLocation &OptionalLoc1,
-                  const StorageLocation &OptionalLoc2,
-                  LatticeTransferState &State) {
-  auto *OptionalVal1 = State.Env.getValue(OptionalLoc1);
-  assert(OptionalVal1 != nullptr);
+void transferSwap(const Expr &E1, SkipPast E1Skip, const Expr &E2,
+                  Environment &Env) {
----------------
sgatev wrote:
> What do you think about passing `const StorageLocation*` instead of `const 
> Expr&`? This way we don't need to pass `E1Skip`.
Sure, but means we'll be pushing the calls to getStorageLocation to callers. 
I'm fine with that, since it means a less janky API, but just want to call that 
out.


================
Comment at: 
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:534
+    if (Loc2 != nullptr)
+      Env.setValue(*Loc2, createOptionalValue(Env, Env.makeAtomicBoolValue()));
+    return;
----------------
sgatev wrote:
> Any reason to not set a fresh value for `Loc1` in this case (similarly a 
> fresh value for `Loc2` below)?
The new value for `Loc1`/`Loc2` won't be connected to anything, so it won't 
bring any benefit to the modeling -- it will only make the code simpler.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142710

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to