diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-09-09 13:45:33 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-09 13:45:33 +0000 |
commit | 55f60bd6fe2db6831762e243577515824e2fca5c (patch) | |
tree | b7fa367ee6c97ae3a5b9ab69bb7b1be0e02418c4 /gcc/rust/backend/rust-compile-extern.h | |
parent | 38f2795947ab8d8080bab81c5e2ccdd24981cbcc (diff) | |
parent | 4faa7d7765f5840779c542430ca6aa9118008a5b (diff) | |
download | gcc-55f60bd6fe2db6831762e243577515824e2fca5c.zip gcc-55f60bd6fe2db6831762e243577515824e2fca5c.tar.gz gcc-55f60bd6fe2db6831762e243577515824e2fca5c.tar.bz2 |
Merge #659
659: Initial intrinsics builtin block r=philberty a=philberty
This is the initial piece to get the simple intrinsic's mapped over to GCC ones. The
GCC wrapper contains a mapping system of rust names over to the builtin gcc names
as far as I can tell gcc will allow for fallback onto linking against -lm.
I think this will be a nice piece of work for new contributors, given the number of intrinsics
Addresses #658
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Co-authored-by: Thomas Schwinge <thomas@codesourcery.com>
Diffstat (limited to 'gcc/rust/backend/rust-compile-extern.h')
-rw-r--r-- | gcc/rust/backend/rust-compile-extern.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-extern.h b/gcc/rust/backend/rust-compile-extern.h index a0ad200..d78a566 100644 --- a/gcc/rust/backend/rust-compile-extern.h +++ b/gcc/rust/backend/rust-compile-extern.h @@ -20,6 +20,7 @@ #define RUST_COMPILE_EXTERN_ITEM #include "rust-compile-base.h" +#include "rust-compile-intrinsic.h" #include "rust-compile-tyty.h" #include "rust-compile-implitem.h" #include "rust-compile-var-decl.h" @@ -118,6 +119,15 @@ public: fntype->override_context (); } + if (fntype->get_abi () == TyTy::FnType::ABI::INTRINSIC) + { + Intrinsics compile (ctx); + Bfunction *fndecl = compile.compile (fntype); + ctx->insert_function_decl (fntype->get_ty_ref (), fndecl, fntype); + return; + } + + rust_assert (fntype->get_abi () == TyTy::FnType::ABI::C); ::Btype *compiled_fn_type = TyTyResolveCompile::compile (ctx, fntype); const unsigned int flags |