Skip to content
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

Add support for restrict attribute on function parameters #26

Merged
merged 1 commit into from Aug 17, 2023

Conversation

GuillaumeGomez
Copy link
Member

No description provided.

Comment on lines +493 to +496
type *get_restrict () const
{
return new type (build_qualified_type (m_inner, TYPE_QUAL_RESTRICT));
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure how relevant this is to libgccjit, but we got patches "rejected" because of implementations in header files, despite having existing implementations in the same header file. I see that get_aligned and get_vector are declared here, so I assume there's a corresponding jit-playback.cc file where the implementation could live? just a little nit but it could help get the patch approved on the GCC side

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the information! I'll give a try like this and if needed, I'll move the function in the source file. But for the time being, for coherency I'll leave it here. :)

@@ -104,6 +104,7 @@ LIBGCCJIT_ABI_0
gcc_jit_type_as_object;
gcc_jit_type_get_const;
gcc_jit_type_get_pointer;
gcc_jit_type_get_restrict;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in a new API section, at the end.

gcc/jit/Changelog:
	* jit-playback.cc: Remove trailing whitespace characters.
	* jit-playback.h: Add get_restrict method.
	* jit-recording.cc: Add get_restrict methods.
	* jit-recording.h: Add get_restrict methods.
	* libgccjit++.h: Add get_restrict methods.
	* libgccjit.cc: Add gcc_jit_type_get_restrict.
	* libgccjit.h: Declare gcc_jit_type_get_restrict.
	* libgccjit.map: Declare gcc_jit_type_get_restrict.

gcc/testsuite/ChangeLog:
	* jit.dg/test-restrict.c: Add test for __restrict__ attribute.

Signed-off-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
@antoyo antoyo merged commit d931e8d into rust-lang:master Aug 17, 2023
1 check passed
@GuillaumeGomez GuillaumeGomez deleted the restrict branch August 17, 2023 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants