diff options
author | Philip Herron <philip.herron@embecosm.com> | 2020-12-15 17:48:11 +0000 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2020-12-17 17:23:46 +0000 |
commit | 6136f0aebbb84cbcf8f92bed206733391aaa3866 (patch) | |
tree | 49c24a3b9c9483bb2755642496bcd0aec3f8c598 /gcc/rust/backend/rust-compile.cc | |
parent | a621e19365473b477d121c28a057cc25d3951c76 (diff) | |
download | gcc-6136f0aebbb84cbcf8f92bed206733391aaa3866.zip gcc-6136f0aebbb84cbcf8f92bed206733391aaa3866.tar.gz gcc-6136f0aebbb84cbcf8f92bed206733391aaa3866.tar.bz2 |
This is a new HIR -> GIMPLE pass it reuses the mappings from hir,
name resolution and type resolution to simplify the generation of
gimple.
Diffstat (limited to 'gcc/rust/backend/rust-compile.cc')
-rw-r--r-- | gcc/rust/backend/rust-compile.cc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc index a4b5cd4..11c380b 100644 --- a/gcc/rust/backend/rust-compile.cc +++ b/gcc/rust/backend/rust-compile.cc @@ -17,16 +17,31 @@ // <http://www.gnu.org/licenses/>. #include "rust-compile.h" -#include "rust-diagnostics.h" +#include "rust-compile-item.h" namespace Rust { namespace Compile { +CompileCrate::CompileCrate (HIR::Crate &crate, Context *ctx) + : crate (crate), ctx (ctx) +{} + CompileCrate::~CompileCrate () {} void CompileCrate::Compile (HIR::Crate &crate, Context *ctx) -{} + +{ + CompileCrate c (crate, ctx); + c.go (); +} + +void +CompileCrate::go () +{ + for (auto it = crate.items.begin (); it != crate.items.end (); it++) + CompileItem::compile (it->get (), ctx); +} } // namespace Compile } // namespace Rust |