llvm-project
03579455 - [Flang][OpenMP] More elegantly handle declare target in unnamed program (#95834)

Commit
1 year ago
[Flang][OpenMP] More elegantly handle declare target in unnamed program (#95834) This PR is related to the following issue: https://github.com/llvm/llvm-project/issues/63362 It tries to solve the crash (which is now slightly different, since the issue has been languishing for a while sorry about that I missed the original issue ping). The crash occurs due to trying to access the symbol of an undefined/unnamed main when trying to find a declare target symbol that has not been specified (but can be assumed based on it's residence in a function or interface). The solution in this PR will check if we're trying to retrieve a main symbol, and then if that is the case, we make sure it exists (due to being named) before we attempt to retrieve it, this avoids the crash. However, that's only part of the issue in the above example, the other is the significant amount of nested directives, I think we are still a little while away from handling this, I have added a reduced variation of the test in the issue as a replicator which contains a lesser number of nesting directives. To push the issue along further, it will likely be a case of working through a number of variations of nested directives in conjunction with target + parallel. However, this PR pushes the issue above to the point where the issue encountered is identical to the following: https://github.com/llvm/llvm-project/issues/67231
Author
Parents
Loading