Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[flang]Add new intrinsic function backtrace and complete the TODO of abort #117603
[flang]Add new intrinsic function backtrace and complete the TODO of abort #117603
Changes from 6 commits
2d5d310
6b57193
0862afd
d28136f
bf60ffe
594c2b3
ca2ceb5
156e434
6c22384
c2e4cca
0270969
d3df426
96a861c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am late in the review, but since this has been reverted, I do not think "elemental" is correct here, and I would also debate the pure aspect since this is doing IO on the standard output which is forbidden for pure subroutine.
In fact, I am not quite sure that the front-end needs to know about backtrace since there are type resolution or argument requiring explicit interface.
It may just be simpler to deal with it like a user procedure for which the runtime provides an implementation (if the user has not). See FDATE implementation for instance.
Please also document the extension support in docs/Intrinsics.md.
Thanks for adding this, it is a great feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I understand what you said. I think you are right. But in this case, it seems to me that the built-in functions such as Abort and Exit need to be rewritten, because they can be regarded as user processes like backtrace. (If I understand correctly) I plan to complete backtrace in the original way first, and rewrite the built-in functions such as Abort and exit in the next new PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I temporarily changed pure to impure to match element (I saw the original Abort implementation was the same). Since the previous PR was problematic and had been rejected, I submitted a new PR after making modifications. You can follow this PR to follow the latest changes.#118179
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think that
Exit
can be rewritten without front-end support because it has an OPTIONAL argument, so it requires an explicit interface. MaybeAbort
could be handled without front-end support, however, I think its NORETURN aspect is something that may be valuable to lowering (not leveraged yet), so it may be worth keeping it like this. @klausler, do you agreeAbort
andExit
need or benefit from front-end support, whileBacktrace
does not?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree.