aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-base.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/backend/rust-compile-base.h')
-rw-r--r--gcc/rust/backend/rust-compile-base.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/gcc/rust/backend/rust-compile-base.h b/gcc/rust/backend/rust-compile-base.h
index c581658..65dc350 100644
--- a/gcc/rust/backend/rust-compile-base.h
+++ b/gcc/rust/backend/rust-compile-base.h
@@ -29,7 +29,14 @@ class HIRCompileBase
public:
virtual ~HIRCompileBase () {}
- static tree address_expression (tree expr, location_t locus);
+ static tree address_expression (tree expr, location_t locus,
+ tree ptrty = NULL_TREE);
+
+ static tree compile_constant_expr (
+ Context *ctx, HirId coercion_id, TyTy::BaseType *resolved_type,
+ TyTy::BaseType *expected_type,
+ const Resolver::CanonicalPath &canonical_path, HIR::Expr &const_value_expr,
+ location_t locus, location_t expr_locus);
protected:
HIRCompileBase (Context *ctx) : ctx (ctx) {}
@@ -90,19 +97,22 @@ protected:
void compile_function_body (tree fndecl, HIR::BlockExpr &function_body,
TyTy::BaseType *fn_return_ty);
- tree compile_constant_item (TyTy::BaseType *resolved_type,
- const Resolver::CanonicalPath *canonical_path,
- HIR::Expr *const_value_expr, location_t locus);
+ tree compile_constant_item (HirId coercion_id, TyTy::BaseType *resolved_type,
+ TyTy::BaseType *expected_type,
+ const Resolver::CanonicalPath &canonical_path,
+ HIR::Expr &const_value_expr, location_t locus,
+ location_t expr_locus);
- tree compile_function (const std::string &fn_name, HIR::SelfParam &self_param,
+ tree compile_function (bool is_root_item, const std::string &fn_name,
+ tl::optional<HIR::SelfParam> &self_param,
std::vector<HIR::FunctionParam> &function_params,
const HIR::FunctionQualifiers &qualifiers,
HIR::Visibility &visibility, AST::AttrVec &outer_attrs,
location_t locus, HIR::BlockExpr *function_body,
- const Resolver::CanonicalPath *canonical_path,
+ const Resolver::CanonicalPath &canonical_path,
TyTy::FnType *fntype);
- static tree unit_expression (Context *ctx, location_t locus);
+ tree unit_expression (location_t locus);
void setup_fndecl (tree fndecl, bool is_main_entry_point, bool is_generic_fn,
HIR::Visibility &visibility,