Add missing attributes to indirect calls for foreign functions#14982
Closed
dotdash wants to merge 1 commit into
Closed
Add missing attributes to indirect calls for foreign functions#14982dotdash wants to merge 1 commit into
dotdash wants to merge 1 commit into
Conversation
Member
|
Instead of adding a |
Member
There was a problem hiding this comment.
Was this accidentally removed?
Contributor
Author
There was a problem hiding this comment.
No, that's on purpose. StructRetAttribute is handled via the attr field of the ArgType.
Edit: The code to set attr to StructRetAttribute was already present and the value is used in add_argument_attributes. We just completely ignored attr here and the hard-coded attribute here had to make up for it.
Contributor
Author
Member
|
Oh sorry! I meant to modify |
Member
|
As in, I meant to recommend you modify |
When calling a foreign function, some arguments and/or return value attributes are required to conform to the foreign ABI. Currently those attributes are only added to the declaration of foreign functions. With direct calls, this is no problem, because LLVM can see that those attributes apply to the call. But with an indirect call, LLVM cannot do that and the attribute is missing. To fix that, we have to add those attribute to the calls to foreign functions as well. This also allows to remove the special handling of the SRet attribute, which is ABI-dependent and will be set via the `attr` field of the return type's `ArgType`.
Contributor
Author
|
Obsoleted by #15005 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When calling a foreign function, some arguments and/or return value
attributes are required to conform to the foreign ABI. Currently those
attributes are only added to the declaration of foreign functions. With
direct calls, this is no problem, because LLVM can see that those
attributes apply to the call. But with an indirect call, LLVM cannot do
that and the attribute is missing.
To fix that, we have to add those attribute to the calls to foreign
functions as well.