This eliminates all uses of the deprecated accessors.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp | ||
---|---|---|
542 | loc == nullptr | |
545 | Should this line instead be outside of this if? So that the flow is Loc = get if (!Loc) Loc = create set(Loc) | |
clang/lib/Analysis/FlowSensitive/Transfer.cpp | ||
473–476 | What happens otherwise? I gather that S just isn't associated with anything? |
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp | ||
---|---|---|
545 | I don't understand -- wouldn't this just be doing unnecessary work? If Loc = cast_or_null<AggregateStorageLocation>( State.Env.getStorageLocationStrict(*E)); returns a non-null Loc, we don't create a new Loc, hence State.Env.setStorageLocationStrict(*E, *Loc); is a no-op, as E is already associated with Loc. | |
clang/lib/Analysis/FlowSensitive/Transfer.cpp | ||
473–476 | Correct. The idea being that if S is elidable, i.e. just a pass-through, we want to pass through any StructValue that we got, and so if we didn't get a StructValue, then we shouldn't pass one through. I guess we could also just create a StructValue from scratch and associate it with ArgLoc, but I'm not sure that it makes much of a difference in practice. |
SGTM
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp | ||
---|---|---|
545 | Right, I was not paying enough attention. I was thinking specifically about the value. basically, i confused line 545 for line 549. |
loc == nullptr