kparzysz wrote:

> Are the symbols not being resolved properly? Or did I miss a point?

I'm working on something different at the moment, but for debugging purposes I 
changed the tree dumper to show symbol information too.  Here's the output for 
this code.  It shows that the variable `my_mapper` in the declare target, and 
in the map clause later on use the same symbol: 0x61f689c35c30.
```
Program -> ProgramUnit -> MainProgram
| ProgramStmt -> Name = '(0x61f689c354b0) [my_prog: MainProgram]'
| SpecificationPart
| | ImplicitPart ->
| | DeclarationConstruct -> SpecificationConstruct -> DerivedTypeDef
| | | DerivedTypeStmt
| | | | Name = '(0x61f689c35870) [my_type: DerivedType components: num]'
| | | ComponentDefStmt -> DataComponentDefStmt
| | | | DeclarationTypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec ->
| | | | ComponentOrFill -> ComponentDecl
| | | | | Name = '(0x61f689c35a50) [num size=4 offset=0: ObjectEntity type: 
INTEGER(4)]'
| | | EndTypeStmt ->
| | DeclarationConstruct -> SpecificationConstruct -> 
OpenMPDeclarativeConstruct -> OpenMPDeclareMapperConstruct
| | | Verbatim
| | | OmpDeclareMapperSpecifier
| | | | Name = '(0x61f689c35c30) [my_mapper: Misc ConstructName]'
| | | | TypeSpec -> DerivedTypeSpec
| | | | | Name = '(0x61f689c35870) [my_type: DerivedType components: num]'
| | | | Name = '(0x61f689c35e10) [my_var (OmpMapToFrom) size=4 offset=0: 
ObjectEntity type: TYPE(my_type)]'
| | | OmpClauseList -> OmpClause -> Map -> OmpMapClause
| | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 
'(0x61f689c35e10) [my_var (OmpMapToFrom) size=4 offset=0: ObjectEntity type: 
TYPE(my_type)]'
| | | | bool = 'true'
| ExecutionPart -> Block
| InternalSubprogramPart
| | ContainsStmt
| | InternalSubprogram -> SubroutineSubprogram
| | | SubroutineStmt
| | | | Name = '(0x61f689c35690) [test (Subroutine): Subprogram ()]'
| | | SpecificationPart
| | | | ImplicitPart ->
| | | | DeclarationConstruct -> SpecificationConstruct -> TypeDeclarationStmt
| | | | | DeclarationTypeSpec -> Type
| | | | | | DerivedTypeSpec
| | | | | | | Name = '(0x61f689c35870) [my_type: DerivedType components: num]'
| | | | | EntityDecl
| | | | | | Name = '(0x61f689c361d0) [xyz (OmpMapTo) size=4 offset=0: 
ObjectEntity type: TYPE(my_type)]'
| | | ExecutionPart -> Block
| | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> 
OpenMPStandaloneConstruct -> OpenMPSimpleStandaloneConstruct
| | | | | OmpSimpleStandaloneDirective -> llvm::omp::Directive = target enter 
data
| | | | | OmpClauseList -> OmpClause -> Map -> OmpMapClause
| | | | | | Modifier -> OmpMapper -> Name = '(0x61f689c35c30) [my_mapper: Misc 
ConstructName]'
| | | | | | Modifier -> OmpMapType -> Value = To
| | | | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 
'(0x61f689c361d0) [xyz (OmpMapTo) size=4 offset=0: ObjectEntity type: 
TYPE(my_type)]'
| | | | | | bool = 'true'
| | | EndSubroutineStmt -> Name = 'test'
| EndProgramStmt -> Name = 'my_prog'
```

https://github.com/llvm/llvm-project/pull/117046
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to