diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-07-26 22:34:14 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-07-27 14:33:43 +0100 |
commit | 2818017d36f5c6279a2372b0a8efbe1f17b3f374 (patch) | |
tree | 539d5f7a8df8ab3fee23fd057914cfc380775358 /gcc/rust/backend/rust-compile-item.h | |
parent | b176f389161bbe30237ff29063697f8e0ccaa513 (diff) | |
download | gcc-2818017d36f5c6279a2372b0a8efbe1f17b3f374.zip gcc-2818017d36f5c6279a2372b0a8efbe1f17b3f374.tar.gz gcc-2818017d36f5c6279a2372b0a8efbe1f17b3f374.tar.bz2 |
Adds support for compilation of extern "C" functions.
This adds extern block compilation support. It currently assumes the C abi
and does not perform any name mangling. It does not support varadic
arguments yet but its the initial support to get this working.
Fixes #421
Diffstat (limited to 'gcc/rust/backend/rust-compile-item.h')
-rw-r--r-- | gcc/rust/backend/rust-compile-item.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-item.h b/gcc/rust/backend/rust-compile-item.h index eacfda9..a6bc7f3 100644 --- a/gcc/rust/backend/rust-compile-item.h +++ b/gcc/rust/backend/rust-compile-item.h @@ -26,6 +26,7 @@ #include "rust-compile-stmt.h" #include "rust-compile-expr.h" #include "rust-compile-fnparam.h" +#include "rust-compile-extern.h" namespace Rust { namespace Compile { @@ -274,6 +275,14 @@ public: compile_fns); } + void visit (HIR::ExternBlock &extern_block) override + { + for (auto &item : extern_block.get_extern_items ()) + { + CompileExternItem::compile (item.get (), ctx, compile_fns, concrete); + } + } + private: CompileItem (Context *ctx, bool compile_fns, TyTy::BaseType *concrete) : HIRCompileBase (ctx), compile_fns (compile_fns), concrete (concrete) |