llvm-project
be006d1a - [flang][OpenMP] Clarify descriptor mapping lifetime warnings (#244624)

Commit
2 days ago
[flang][OpenMP] Clarify descriptor mapping lifetime warnings (#244624) Mapping an allocatable component such as `this%arr` with `target enter data` can produce a warning about a locally created descriptor, even when the descriptor belongs to the caller’s derived-type object. Give these cases a dedicated warning explaining that an exit through a nonallocatable assumed-shape dummy does not identify the original component descriptor. Recommend a direct component exit or an `ALLOCATABLE` helper dummy for matching cleanup. | Aspect | Before | After | |---|---|---| | Component identification | Names and highlights `arr` | Names and highlights the full designator, `this%arr` | | Explanation | Describes a potentially local descriptor | Explains that releasing allocated storage may leave its descriptor mapped | | Cleanup guidance | Recommends `TARGET EXIT DATA` in the same scope | Recommends a direct component exit or an `ALLOCATABLE` helper dummy | | `ref_ptee` guidance | Available from OpenMP 6.1 | Available from OpenMP 6.0; omitted in older modes | Assisted-by: OpenAI Codex
Author
Parents
Loading