When creating temporary from a polymorphic entity, its dynamic type
information must be carried over to the temporary.
This patch updates createTempMutableBox to support passing a source_box
from which the information will be carried over.
This is tested on the spread intrinsic and follow-up patches will updates
other temporary creation where needed.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM functionally.
flang/lib/Optimizer/Builder/MutableBox.cpp | ||
---|---|---|
195 | I was wondering about the name "sourceBox". It makes sense when you know you are working on the type, but I think a new reader might have trouble understanding its purpose at first (is it the source of a storage, of a value., of a type...). Would it makes sense to you to use "typeSourceBox" to insist that we only care about the dynamic type coming from this box ? |
flang/lib/Optimizer/Builder/MutableBox.cpp | ||
---|---|---|
195 | Yeah it makes sense to insist that we care about the dynamic type information here and nothing else in the box. I'll update it before merging. |
I was wondering about the name "sourceBox". It makes sense when you know you are working on the type, but I think a new reader might have trouble understanding its purpose at first (is it the source of a storage, of a value., of a type...). Would it makes sense to you to use "typeSourceBox" to insist that we only care about the dynamic type coming from this box ?