diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2022-09-24 18:25:34 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2023-09-21 11:15:02 +0200 |
commit | b1c06fd9723453dd2b2ec306684cb806dc2b4fbb (patch) | |
tree | da0349bdabb9fec608f498981edc5ebd94aeb905 /gcc/rust | |
parent | 9b5b2c9f95056f97cf95f0e8d970015aa586497b (diff) | |
download | gcc-b1c06fd9723453dd2b2ec306684cb806dc2b4fbb.zip gcc-b1c06fd9723453dd2b2ec306684cb806dc2b4fbb.tar.gz gcc-b1c06fd9723453dd2b2ec306684cb806dc2b4fbb.tar.bz2 |
rust: Add skeleton support and documentation for targetrustm hooks.
gcc/ChangeLog:
* Makefile.in (tm_rust_file_list, tm_rust_include_list, TM_RUST_H,
RUST_TARGET_DEF, RUST_TARGET_H, RUST_TARGET_OBJS): New variables.
(tm_rust.h, cs-tm_rust.h, default-rust.o,
rust/rust-target-hooks-def.h, s-rust-target-hooks-def-h): New rules.
(s-tm-texi): Also check timestamp on rust-target.def.
(generated_files): Add TM_RUST_H and rust-target-hooks-def.h.
(build/genhooks.o): Also depend on RUST_TARGET_DEF.
* config.gcc (tm_rust_file, rust_target_objs, target_has_targetrustm):
New variables.
* configure: Regenerate.
* configure.ac (tm_rust_file_list, tm_rust_include_list,
rust_target_objs): Add substitutes.
* doc/tm.texi: Regenerate.
* doc/tm.texi.in (targetrustm): Document.
(target_has_targetrustm): Document.
* genhooks.cc: Include rust/rust-target.def.
* config/default-rust.cc: New file.
gcc/rust/ChangeLog:
* rust-target-def.h: New file.
* rust-target.def: New file.
* rust-target.h: New file.
Diffstat (limited to 'gcc/rust')
-rw-r--r-- | gcc/rust/rust-target-def.h | 20 | ||||
-rw-r--r-- | gcc/rust/rust-target.def | 32 | ||||
-rw-r--r-- | gcc/rust/rust-target.h | 31 |
3 files changed, 83 insertions, 0 deletions
diff --git a/gcc/rust/rust-target-def.h b/gcc/rust/rust-target-def.h new file mode 100644 index 0000000..8534c4b --- /dev/null +++ b/gcc/rust/rust-target-def.h @@ -0,0 +1,20 @@ +/* Default initializers for Rust target hooks. + Copyright (C) 2022 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + +#include "rust/rust-target-hooks-def.h" +#include "tree.h" +#include "hooks.h" diff --git a/gcc/rust/rust-target.def b/gcc/rust/rust-target.def new file mode 100644 index 0000000..c800eef --- /dev/null +++ b/gcc/rust/rust-target.def @@ -0,0 +1,32 @@ +/* Target hook definitions for the Rust front end. + Copyright (C) 2022 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + +/* See target-hooks-macros.h for details of macros that should be + provided by the including file, and how to use them here. */ + +#include "target-hooks-macros.h" + +#undef HOOK_TYPE +#define HOOK_TYPE "Rust Target Hook" + +HOOK_VECTOR (TARGETRUSTM_INITIALIZER, gcc_targetrustm) + +#undef HOOK_PREFIX +#define HOOK_PREFIX "TARGET_" + +/* Close the 'struct gcc_targetrustm' definition. */ +HOOK_VECTOR_END (C90_EMPTY_HACK) diff --git a/gcc/rust/rust-target.h b/gcc/rust/rust-target.h new file mode 100644 index 0000000..79edd78 --- /dev/null +++ b/gcc/rust/rust-target.h @@ -0,0 +1,31 @@ +/* Data structure definitions for target-specific Rust behavior. + Copyright (C) 2022 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + +#ifndef GCC_RUST_TARGET_H +#define GCC_RUST_TARGET_H + +#define DEFHOOKPOD(NAME, DOC, TYPE, INIT) TYPE NAME; +#define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (*NAME) PARAMS; +#define DEFHOOK_UNDOC DEFHOOK +#define HOOKSTRUCT(FRAGMENT) FRAGMENT + +#include "rust-target.def" + +/* Each target can provide their own. */ +extern struct gcc_targetrustm targetrustm; + +#endif /* GCC_RUST_TARGET_H */ |