aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit/libgccjit.c
diff options
context:
space:
mode:
authorAntoni Boucher <bouanto@zoho.com>2021-12-12 16:16:21 -0500
committerAntoni Boucher <bouanto@zoho.com>2021-12-12 16:16:23 -0500
commit0b52083ea2c2dd9897031fdc3802a68fd4aa45ef (patch)
tree38c90893498f6f89ee9616f5bbb567240bfc1311 /gcc/jit/libgccjit.c
parentaeedb00a1ae2ccd10b1a5f00ff466081aeadb54b (diff)
downloadgcc-0b52083ea2c2dd9897031fdc3802a68fd4aa45ef.zip
gcc-0b52083ea2c2dd9897031fdc3802a68fd4aa45ef.tar.gz
gcc-0b52083ea2c2dd9897031fdc3802a68fd4aa45ef.tar.bz2
libgccjit: Add support for setting the link section of global variables [PR100688]
2021-12-12 Antoni Boucher <bouanto@zoho.com> gcc/jit/ PR target/100688 * docs/topics/compatibility.rst (LIBGCCJIT_ABI_18): New ABI tag. * docs/topics/expressions.rst: Add documentation for the function gcc_jit_lvalue_set_link_section. * jit-playback.h: New function (set_link_section). * jit-recording.c: New function (set_link_section) and support for setting the link section. * jit-recording.h: New function (set_link_section) and new field m_link_section. * libgccjit.c: New function (gcc_jit_lvalue_set_link_section). * libgccjit.h: New function (gcc_jit_lvalue_set_link_section). * libgccjit.map (LIBGCCJIT_ABI_18): New ABI tag. gcc/testsuite/ PR target/100688 * jit.dg/all-non-failing-tests.h: Mention new test link-section-assembler. * jit.dg/test-link-section-assembler.c: New test. * jit.dg/jit.exp: New helper function to test that the assembly contains a pattern.
Diffstat (limited to 'gcc/jit/libgccjit.c')
-rw-r--r--gcc/jit/libgccjit.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
index 7ccb76a..59cef61 100644
--- a/gcc/jit/libgccjit.c
+++ b/gcc/jit/libgccjit.c
@@ -2238,6 +2238,19 @@ gcc_jit_lvalue_set_tls_model (gcc_jit_lvalue *lvalue,
/* Public entrypoint. See description in libgccjit.h.
After error-checking, the real work is done by the
+ gcc::jit::recording::lvalue::set_link_section method in jit-recording.c. */
+
+void
+gcc_jit_lvalue_set_link_section (gcc_jit_lvalue *lvalue,
+ const char *section_name)
+{
+ RETURN_IF_FAIL (section_name, NULL, NULL, "NULL section_name");
+ lvalue->set_link_section (section_name);
+}
+
+/* Public entrypoint. See description in libgccjit.h.
+
+ After error-checking, the real work is done by the
gcc::jit::recording::function::new_local method in jit-recording.c. */
gcc_jit_lvalue *