This patch adds runtime default initialization for polymorphic
dummy argument. The dynamic type might require default initialization
but not the declared type.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Do it for polymorphic dummy as the dynamic type might
require default initialization but not the declared type
Aside from the question on the comment, all builds and tests correctly and looks good.
flang/lib/Lower/ConvertVariable.cpp | ||
---|---|---|
628 | Shouldn't this comment say "needs" rather than "might need"? |
flang/lib/Lower/ConvertVariable.cpp | ||
---|---|---|
628 | I think "might need" is more accurate in the sense that the storage may not need default initialization: it only needs it if the dynamic type requires it. However, we do not know the dynamic type at compile time, so we must call the runtime, but the runtime may not do anything if the dynamic type turns out to not have a default initial value. |
flang/lib/Lower/ConvertVariable.cpp | ||
---|---|---|
628 | Jean is correct here. We are not sure it need default initialization but since it might we delegate it to the runtime. |
Shouldn't this comment say "needs" rather than "might need"?