diff options
| author | Abid Qadeer <haqadeer@amd.com> | 2024-08-27 11:10:11 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-27 11:10:11 +0100 |
| commit | bc4bedd5ed2c8d9f1a648c72d38e17361aff8a30 (patch) | |
| tree | 6d902a2632a90b5aaa2e2770bd7aab6ebdc20b13 /lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h | |
| parent | ad468da03815478ceab7c553e651c1a39a479738 (diff) | |
| download | llvm-bc4bedd5ed2c8d9f1a648c72d38e17361aff8a30.zip llvm-bc4bedd5ed2c8d9f1a648c72d38e17361aff8a30.tar.gz llvm-bc4bedd5ed2c8d9f1a648c72d38e17361aff8a30.tar.bz2 | |
[mlir][debug] Handle DIImportedEntity. (#103055)
The `DIImporedEntity` can be used to represent imported entities like
C++'s namespace with using directive or fortran's moudule with use
statement.
This PR adds `DIImportedEntityAttr` and 2-way translation from
`DIImportedEntity` to `DIImportedEntityAttr` and vice versa.
When an entity is imported in a function, the `retainedNodes` field of
the `DISubprogram` contains all the imported nodes. See the C++ code and
the LLVM IR below.
```
void test() {
using namespace n1;
...
}
!2 = !DINamespace(name: "n1", scope: null)
!16 = distinct !DISubprogram(name: "test", ..., retainedNodes: !19) !19 = !{!20}
!20 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !16, entity: !2 ...)
```
This PR makes sure that the translation from mlir to `retainedNodes`
field happens correctly both ways.
To side step the cyclic dependency between `DISubprogramAttr` and `DIImportedEntityAttr`,
we have decided to not have `scope` field in the `DIImportedEntityAttr` and it is inferred
from the entity which hold the list of `DIImportedEntityAttr`. A `retainedNodes` field has been
added in the `DISubprogramAttr` which contains the list of `DIImportedEntityAttr` for that
function.
This PR currently does not handle entities imported in a global scope
but that should be easy to handle in a subsequent PR.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h')
0 files changed, 0 insertions, 0 deletions
