diff options
Diffstat (limited to 'gcc/rust/backend')
-rw-r--r-- | gcc/rust/backend/rust-compile-item.h | 6 | ||||
-rw-r--r-- | gcc/rust/backend/rust-compile.cc | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-item.h b/gcc/rust/backend/rust-compile-item.h index 719d51c..8b36289 100644 --- a/gcc/rust/backend/rust-compile-item.h +++ b/gcc/rust/backend/rust-compile-item.h @@ -301,6 +301,12 @@ public: } } + void visit (HIR::ModuleBodied &module) override + { + for (auto &item : module.get_items ()) + CompileItem::compile (item.get (), ctx, compile_fns); + } + private: CompileItem (Context *ctx, bool compile_fns, TyTy::BaseType *concrete) : HIRCompileBase (ctx), compile_fns (compile_fns), concrete (concrete) diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc index 3c6a188..b9b5084 100644 --- a/gcc/rust/backend/rust-compile.cc +++ b/gcc/rust/backend/rust-compile.cc @@ -88,6 +88,7 @@ CompileExpr::visit (HIR::CallExpr &expr) { // must be a call to a function Bexpression *fn = CompileExpr::Compile (expr.get_fnexpr (), ctx); + rust_assert (fn != nullptr); std::vector<Bexpression *> args; expr.iterate_params ([&] (HIR::Expr *p) mutable -> bool { |