This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. mboehme marked an inline comment as done. Closed by commit rG243a79ca01f8: [clang][dataflow] Simplify implementation of `transferStdForwardCall()` in… (authored by mboehme).
Changed prior to commit: https://reviews.llvm.org/D155202?vs=540023&id=540882#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155202/new/ https://reviews.llvm.org/D155202 Files: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp Index: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp =================================================================== --- clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp +++ clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp @@ -683,25 +683,8 @@ LatticeTransferState &State) { assert(E->getNumArgs() == 1); - StorageLocation *LocRet = State.Env.getStorageLocation(*E, SkipPast::None); - if (LocRet != nullptr) - return; - - StorageLocation *LocArg = - State.Env.getStorageLocation(*E->getArg(0), SkipPast::Reference); - - if (LocArg == nullptr) - return; - - Value *ValArg = State.Env.getValue(*LocArg); - if (ValArg == nullptr) - ValArg = &createOptionalValue(State.Env.makeAtomicBoolValue(), State.Env); - - // Create a new storage location - LocRet = &State.Env.createStorageLocation(*E); - State.Env.setStorageLocation(*E, *LocRet); - - State.Env.setValue(*LocRet, *ValArg); + if (auto *Loc = State.Env.getStorageLocationStrict(*E->getArg(0))) + State.Env.setStorageLocationStrict(*E, *Loc); } const Formula &evaluateEquality(Arena &A, const Formula &EqVal,
Index: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp =================================================================== --- clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp +++ clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp @@ -683,25 +683,8 @@ LatticeTransferState &State) { assert(E->getNumArgs() == 1); - StorageLocation *LocRet = State.Env.getStorageLocation(*E, SkipPast::None); - if (LocRet != nullptr) - return; - - StorageLocation *LocArg = - State.Env.getStorageLocation(*E->getArg(0), SkipPast::Reference); - - if (LocArg == nullptr) - return; - - Value *ValArg = State.Env.getValue(*LocArg); - if (ValArg == nullptr) - ValArg = &createOptionalValue(State.Env.makeAtomicBoolValue(), State.Env); - - // Create a new storage location - LocRet = &State.Env.createStorageLocation(*E); - State.Env.setStorageLocation(*E, *LocRet); - - State.Env.setValue(*LocRet, *ValArg); + if (auto *Loc = State.Env.getStorageLocationStrict(*E->getArg(0))) + State.Env.setStorageLocationStrict(*E, *Loc); } const Formula &evaluateEquality(Arena &A, const Formula &EqVal,
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits