public inbox for gcc-rust@gcc.gnu.org
 help / color / mirror / Atom feed
From: arthur.cohen@embecosm.com
To: gcc-patches@gcc.gnu.org
Cc: gcc-rust@gcc.gnu.org, Philip Herron <philip.herron@embecosm.com>
Subject: [committed 050/103] gccrs: Closure support at CallExpr
Date: Tue, 21 Feb 2023 13:01:40 +0100	[thread overview]
Message-ID: <20230221120230.596966-51-arthur.cohen@embecosm.com> (raw)
In-Reply-To: <20230221120230.596966-1-arthur.cohen@embecosm.com>

From: Philip Herron <philip.herron@embecosm.com>

gcc/rust/ChangeLog:

	* backend/rust-compile-context.h: Add new functions: `insert_closure_decl` and
	`lookup_closure_decl`.
	* backend/rust-compile-expr.cc (CompileExpr::visit): Start compiling Closures properly.
	(CompileExpr::generate_closure_function): New function.
	(CompileExpr::generate_closure_fntype): Likewise.
	* backend/rust-compile-expr.h: Declare `generate_closure_function` and
	`generate_closure_fntype`.
	* backend/rust-compile-type.cc (TyTyResolveCompile::visit): Visit closure types properly.
	* backend/rust-mangle.cc (legacy_mangle_name): Add support for closures.
	* backend/rust-tree.h (RS_CLOSURE_FLAG): Add new tree macro.
	(RS_CLOSURE_TYPE_P): And checking for it on tree nodes.
	* typecheck/rust-tyty.cc (ClosureType::is_equal): Add implementation.

gcc/testsuite/ChangeLog:

	* rust/execute/torture/closure1.rs: New test.
---
 gcc/rust/backend/rust-compile-context.h       |  31 ++
 gcc/rust/backend/rust-compile-expr.cc         | 280 +++++++++++++++++-
 gcc/rust/backend/rust-compile-expr.h          |  10 +
 gcc/rust/backend/rust-compile-type.cc         |  10 +-
 gcc/rust/backend/rust-mangle.cc               |   6 +
 gcc/rust/backend/rust-tree.h                  |   5 +
 gcc/rust/typecheck/rust-tyty.cc               |  13 +-
 .../rust/execute/torture/closure1.rs          |  18 ++
 8 files changed, 361 insertions(+), 12 deletions(-)
 create mode 100644 gcc/testsuite/rust/execute/torture/closure1.rs

diff --git a/gcc/rust/backend/rust-compile-context.h b/gcc/rust/backend/rust-compile-context.h
index 49f78e19b20..d2d3a53f182 100644
--- a/gcc/rust/backend/rust-compile-context.h
+++ b/gcc/rust/backend/rust-compile-context.h
@@ -147,6 +147,35 @@ public:
     mono_fns[dId].push_back ({ref, fn});
   }
 
+  void insert_closure_decl (const TyTy::ClosureType *ref, tree fn)
+  {
+    auto dId = ref->get_def_id ();
+    auto it = mono_closure_fns.find (dId);
+    if (it == mono_closure_fns.end ())
+      mono_closure_fns[dId] = {};
+
+    mono_closure_fns[dId].push_back ({ref, fn});
+  }
+
+  tree lookup_closure_decl (const TyTy::ClosureType *ref)
+  {
+    auto dId = ref->get_def_id ();
+    auto it = mono_closure_fns.find (dId);
+    if (it == mono_closure_fns.end ())
+      return error_mark_node;
+
+    for (auto &i : it->second)
+      {
+	const TyTy::ClosureType *t = i.first;
+	tree fn = i.second;
+
+	if (ref->is_equal (*t))
+	  return fn;
+      }
+
+    return error_mark_node;
+  }
+
   bool lookup_function_decl (HirId id, tree *fn, DefId dId = UNKNOWN_DEFID,
 			     const TyTy::BaseType *ref = nullptr,
 			     const std::string &asm_name = std::string ())
@@ -343,6 +372,8 @@ private:
   std::vector<tree> loop_begin_labels;
   std::map<DefId, std::vector<std::pair<const TyTy::BaseType *, tree>>>
     mono_fns;
+  std::map<DefId, std::vector<std::pair<const TyTy::ClosureType *, tree>>>
+    mono_closure_fns;
   std::map<HirId, tree> implicit_pattern_bindings;
   std::map<hashval_t, tree> main_variants;
 
diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc
index 724a93a68bd..d2d9ae0a233 100644
--- a/gcc/rust/backend/rust-compile-expr.cc
+++ b/gcc/rust/backend/rust-compile-expr.cc
@@ -1589,9 +1589,7 @@ CompileExpr::visit (HIR::CallExpr &expr)
     }
 
   // must be a tuple constructor
-  bool is_fn = tyty->get_kind () == TyTy::TypeKind::FNDEF
-	       || tyty->get_kind () == TyTy::TypeKind::FNPTR;
-  bool is_adt_ctor = !is_fn;
+  bool is_adt_ctor = tyty->get_kind () == TyTy::TypeKind::ADT;
   if (is_adt_ctor)
     {
       rust_assert (tyty->get_kind () == TyTy::TypeKind::ADT);
@@ -1692,6 +1690,57 @@ CompileExpr::visit (HIR::CallExpr &expr)
     return true;
   };
 
+  auto fn_address = CompileExpr::Compile (expr.get_fnexpr (), ctx);
+
+  // is this a closure call?
+  if (RS_CLOSURE_TYPE_P (TREE_TYPE (fn_address)))
+    {
+      rust_assert (tyty->get_kind () == TyTy::TypeKind::CLOSURE);
+      TyTy::ClosureType *closure = static_cast<TyTy::ClosureType *> (tyty);
+
+      std::vector<tree> tuple_arg_vals;
+      for (auto &argument : expr.get_arguments ())
+	{
+	  auto rvalue = CompileExpr::Compile (argument.get (), ctx);
+	  tuple_arg_vals.push_back (rvalue);
+	}
+
+      tree tuple_args_tyty
+	= TyTyResolveCompile::compile (ctx, &closure->get_parameters ());
+      tree tuple_args
+	= ctx->get_backend ()->constructor_expression (tuple_args_tyty, false,
+						       tuple_arg_vals, -1,
+						       expr.get_locus ());
+
+      // need to apply any autoderef's to the self argument
+      HirId autoderef_mappings_id = expr.get_mappings ().get_hirid ();
+      std::vector<Resolver::Adjustment> *adjustments = nullptr;
+      bool ok
+	= ctx->get_tyctx ()->lookup_autoderef_mappings (autoderef_mappings_id,
+							&adjustments);
+      rust_assert (ok);
+
+      // apply adjustments for the fn call
+      tree self
+	= resolve_adjustements (*adjustments, fn_address, expr.get_locus ());
+
+      // args are always self, and the tuple of the args we are passing where
+      // self is the path of the call-expr in this case the fn_address
+      std::vector<tree> args;
+      args.push_back (self);
+      args.push_back (tuple_args);
+
+      // get the fn call address
+      tree closure_call_site = ctx->lookup_closure_decl (closure);
+      tree closure_call_address
+	= address_expression (closure_call_site, expr.get_locus ());
+      translated
+	= ctx->get_backend ()->call_expression (closure_call_address, args,
+						nullptr /* static chain ?*/,
+						expr.get_locus ());
+      return;
+    }
+
   bool is_varadic = false;
   if (tyty->get_kind () == TyTy::TypeKind::FNDEF)
     {
@@ -1699,13 +1748,13 @@ CompileExpr::visit (HIR::CallExpr &expr)
       is_varadic = fn->is_varadic ();
     }
 
-  size_t required_num_args;
+  size_t required_num_args = expr.get_arguments ().size ();
   if (tyty->get_kind () == TyTy::TypeKind::FNDEF)
     {
       const TyTy::FnType *fn = static_cast<const TyTy::FnType *> (tyty);
       required_num_args = fn->num_params ();
     }
-  else
+  else if (tyty->get_kind () == TyTy::TypeKind::FNPTR)
     {
       const TyTy::FnPtr *fn = static_cast<const TyTy::FnPtr *> (tyty);
       required_num_args = fn->num_params ();
@@ -1746,8 +1795,7 @@ CompileExpr::visit (HIR::CallExpr &expr)
       args.push_back (rvalue);
     }
 
-  // must be a call to a function
-  auto fn_address = CompileExpr::Compile (expr.get_fnexpr (), ctx);
+  // must be a regular call to a function
   translated = ctx->get_backend ()->call_expression (fn_address, args, nullptr,
 						     expr.get_locus ());
 }
@@ -2806,7 +2854,223 @@ CompileExpr::visit (HIR::ArrayIndexExpr &expr)
 void
 CompileExpr::visit (HIR::ClosureExpr &expr)
 {
-  gcc_unreachable ();
+  TyTy::BaseType *closure_expr_ty = nullptr;
+  if (!ctx->get_tyctx ()->lookup_type (expr.get_mappings ().get_hirid (),
+				       &closure_expr_ty))
+    {
+      rust_fatal_error (expr.get_locus (),
+			"did not resolve type for this ClosureExpr");
+      return;
+    }
+  rust_assert (closure_expr_ty->get_kind () == TyTy::TypeKind::CLOSURE);
+  TyTy::ClosureType *closure_tyty
+    = static_cast<TyTy::ClosureType *> (closure_expr_ty);
+  tree compiled_closure_tyty = TyTyResolveCompile::compile (ctx, closure_tyty);
+
+  // generate closure function
+  generate_closure_function (expr, *closure_tyty, compiled_closure_tyty);
+
+  // lets ignore state capture for now we need to instantiate the struct anyway
+  // then generate the function
+
+  std::vector<tree> vals;
+  // TODO
+  // setup argument captures based on the mode?
+
+  translated
+    = ctx->get_backend ()->constructor_expression (compiled_closure_tyty, false,
+						   vals, -1, expr.get_locus ());
+}
+
+tree
+CompileExpr::generate_closure_function (HIR::ClosureExpr &expr,
+					TyTy::ClosureType &closure_tyty,
+					tree compiled_closure_tyty)
+{
+  TyTy::FnType *fn_tyty = nullptr;
+  tree compiled_fn_type
+    = generate_closure_fntype (expr, closure_tyty, compiled_closure_tyty,
+			       &fn_tyty);
+  if (compiled_fn_type == error_mark_node)
+    return error_mark_node;
+
+  const Resolver::CanonicalPath &parent_canonical_path
+    = closure_tyty.get_ident ().path;
+  Resolver::CanonicalPath path = parent_canonical_path.append (
+    Resolver::CanonicalPath::new_seg (UNKNOWN_NODEID, "{{closure}}"));
+
+  std::string ir_symbol_name = path.get ();
+  std::string asm_name = ctx->mangle_item (&closure_tyty, path);
+
+  unsigned int flags = 0;
+  tree fndecl
+    = ctx->get_backend ()->function (compiled_fn_type, ir_symbol_name, asm_name,
+				     flags, expr.get_locus ());
+
+  // insert into the context
+  ctx->insert_function_decl (fn_tyty, fndecl);
+  ctx->insert_closure_decl (&closure_tyty, fndecl);
+
+  // setup the parameters
+  std::vector<Bvariable *> param_vars;
+
+  // closure self
+  Bvariable *self_param
+    = ctx->get_backend ()->parameter_variable (fndecl, "$closure",
+					       compiled_closure_tyty,
+					       expr.get_locus ());
+  DECL_ARTIFICIAL (self_param->get_decl ()) = 1;
+  param_vars.push_back (self_param);
+
+  // setup the implicit argument captures
+  // TODO
+
+  // args tuple
+  tree args_type
+    = TyTyResolveCompile::compile (ctx, &closure_tyty.get_parameters ());
+  Bvariable *args_param
+    = ctx->get_backend ()->parameter_variable (fndecl, "args", args_type,
+					       expr.get_locus ());
+  param_vars.push_back (args_param);
+
+  // setup the implicit mappings for the arguments. Since argument passing to
+  // closure functions is done via passing a tuple but the closure body expects
+  // just normal arguments this means we need to destructure them similar to
+  // what we do in MatchExpr's. This means when we have a closure-param of a we
+  // actually setup the destructure to take from the args tuple
+
+  tree args_param_expr = args_param->get_tree (expr.get_locus ());
+  size_t i = 0;
+  for (auto &closure_param : expr.get_params ())
+    {
+      tree compiled_param_var = ctx->get_backend ()->struct_field_expression (
+	args_param_expr, i, closure_param.get_locus ());
+
+      const HIR::Pattern &param_pattern = *closure_param.get_pattern ();
+      ctx->insert_pattern_binding (
+	param_pattern.get_pattern_mappings ().get_hirid (), compiled_param_var);
+      i++;
+    }
+
+  if (!ctx->get_backend ()->function_set_parameters (fndecl, param_vars))
+    return error_mark_node;
+
+  // lookup locals
+  HIR::Expr *function_body = expr.get_expr ().get ();
+  auto body_mappings = function_body->get_mappings ();
+  Resolver::Rib *rib = nullptr;
+  bool ok
+    = ctx->get_resolver ()->find_name_rib (body_mappings.get_nodeid (), &rib);
+  rust_assert (ok);
+
+  std::vector<Bvariable *> locals
+    = compile_locals_for_block (ctx, *rib, fndecl);
+
+  tree enclosing_scope = NULL_TREE;
+  Location start_location = function_body->get_locus ();
+  Location end_location = function_body->get_locus ();
+  bool is_block_expr
+    = function_body->get_expression_type () == HIR::Expr::ExprType::Block;
+  if (is_block_expr)
+    {
+      HIR::BlockExpr *body = static_cast<HIR::BlockExpr *> (function_body);
+      start_location = body->get_locus ();
+      end_location = body->get_end_locus ();
+    }
+
+  tree code_block = ctx->get_backend ()->block (fndecl, enclosing_scope, locals,
+						start_location, end_location);
+  ctx->push_block (code_block);
+
+  TyTy::BaseType *tyret = &closure_tyty.get_result_type ();
+  bool function_has_return = !closure_tyty.get_result_type ().is_unit ();
+  Bvariable *return_address = nullptr;
+  if (function_has_return)
+    {
+      tree return_type = TyTyResolveCompile::compile (ctx, tyret);
+
+      bool address_is_taken = false;
+      tree ret_var_stmt = NULL_TREE;
+
+      return_address = ctx->get_backend ()->temporary_variable (
+	fndecl, code_block, return_type, NULL, address_is_taken,
+	expr.get_locus (), &ret_var_stmt);
+
+      ctx->add_statement (ret_var_stmt);
+    }
+
+  ctx->push_fn (fndecl, return_address);
+
+  if (is_block_expr)
+    {
+      HIR::BlockExpr *body = static_cast<HIR::BlockExpr *> (function_body);
+      compile_function_body (ctx, fndecl, *body, true);
+    }
+  else
+    {
+      tree value = CompileExpr::Compile (function_body, ctx);
+      tree return_expr
+	= ctx->get_backend ()->return_statement (fndecl, {value},
+						 function_body->get_locus ());
+      ctx->add_statement (return_expr);
+    }
+
+  tree bind_tree = ctx->pop_block ();
+
+  gcc_assert (TREE_CODE (bind_tree) == BIND_EXPR);
+  DECL_SAVED_TREE (fndecl) = bind_tree;
+
+  ctx->pop_fn ();
+  ctx->push_function (fndecl);
+
+  return fndecl;
+}
+
+tree
+CompileExpr::generate_closure_fntype (HIR::ClosureExpr &expr,
+				      const TyTy::ClosureType &closure_tyty,
+				      tree compiled_closure_tyty,
+				      TyTy::FnType **fn_tyty)
+{
+  // grab the specified_bound
+  rust_assert (closure_tyty.num_specified_bounds () == 1);
+  const TyTy::TypeBoundPredicate &predicate
+    = *closure_tyty.get_specified_bounds ().begin ();
+
+  // ensure the fn_once_output associated type is set
+  closure_tyty.setup_fn_once_output ();
+
+  // the function signature is based on the trait bound that the closure
+  // implements which is determined at the type resolution time
+  //
+  // https://github.com/rust-lang/rust/blob/7807a694c2f079fd3f395821bcc357eee8650071/library/core/src/ops/function.rs#L54-L71
+
+  TyTy::TypeBoundPredicateItem item = TyTy::TypeBoundPredicateItem::error ();
+  if (predicate.get_name ().compare ("FnOnce") == 0)
+    {
+      item = predicate.lookup_associated_item ("call_once");
+    }
+  else if (predicate.get_name ().compare ("FnMut") == 0)
+    {
+      item = predicate.lookup_associated_item ("call_mut");
+    }
+  else if (predicate.get_name ().compare ("Fn") == 0)
+    {
+      item = predicate.lookup_associated_item ("call");
+    }
+  else
+    {
+      // FIXME error message?
+      gcc_unreachable ();
+      return error_mark_node;
+    }
+
+  rust_assert (!item.is_error ());
+
+  TyTy::BaseType *item_tyty = item.get_tyty_for_receiver (&closure_tyty);
+  rust_assert (item_tyty->get_kind () == TyTy::TypeKind::FNDEF);
+  *fn_tyty = static_cast<TyTy::FnType *> (item_tyty);
+  return TyTyResolveCompile::compile (ctx, item_tyty);
 }
 
 } // namespace Compile
diff --git a/gcc/rust/backend/rust-compile-expr.h b/gcc/rust/backend/rust-compile-expr.h
index 7fc3f5e7f4d..c734406e0da 100644
--- a/gcc/rust/backend/rust-compile-expr.h
+++ b/gcc/rust/backend/rust-compile-expr.h
@@ -142,6 +142,16 @@ protected:
 			  const TyTy::ArrayType &array_tyty, tree array_type,
 			  HIR::ArrayElemsCopied &elems);
 
+protected:
+  tree generate_closure_function (HIR::ClosureExpr &expr,
+				  TyTy::ClosureType &closure_tyty,
+				  tree compiled_closure_tyty);
+
+  tree generate_closure_fntype (HIR::ClosureExpr &expr,
+				const TyTy::ClosureType &closure_tyty,
+				tree compiled_closure_tyty,
+				TyTy::FnType **fn_tyty);
+
 private:
   CompileExpr (Context *ctx);
 
diff --git a/gcc/rust/backend/rust-compile-type.cc b/gcc/rust/backend/rust-compile-type.cc
index fe1b7ce95e3..824cb3a56ef 100644
--- a/gcc/rust/backend/rust-compile-type.cc
+++ b/gcc/rust/backend/rust-compile-type.cc
@@ -97,9 +97,15 @@ TyTyResolveCompile::visit (const TyTy::InferType &)
 }
 
 void
-TyTyResolveCompile::visit (const TyTy::ClosureType &)
+TyTyResolveCompile::visit (const TyTy::ClosureType &type)
 {
-  gcc_unreachable ();
+  std::vector<Backend::typed_identifier> fields;
+  tree type_record = ctx->get_backend ()->struct_type (fields);
+  RS_CLOSURE_FLAG (type_record) = 1;
+
+  std::string named_struct_str = type.get_ident ().path.get () + "{{closure}}";
+  translated = ctx->get_backend ()->named_type (named_struct_str, type_record,
+						type.get_ident ().locus);
 }
 
 void
diff --git a/gcc/rust/backend/rust-mangle.cc b/gcc/rust/backend/rust-mangle.cc
index 4d202078a70..83aefa7997a 100644
--- a/gcc/rust/backend/rust-mangle.cc
+++ b/gcc/rust/backend/rust-mangle.cc
@@ -13,6 +13,8 @@ static const std::string kMangledRef = "$RF$";
 static const std::string kMangledPtr = "$BP$";
 static const std::string kMangledLeftSqParen = "$u5b$";	 // [
 static const std::string kMangledRightSqParen = "$u5d$"; // ]
+static const std::string kMangledLeftBrace = "$u7b$";	 // {
+static const std::string kMangledRightBrace = "$u7d$";	 // }
 static const std::string kQualPathBegin = "_" + kMangledSubstBegin;
 static const std::string kMangledComma = "$C$";
 
@@ -66,6 +68,10 @@ legacy_mangle_name (const std::string &name)
 	m = kMangledLeftSqParen;
       else if (c == ']')
 	m = kMangledRightSqParen;
+      else if (c == '{')
+	m = kMangledLeftBrace;
+      else if (c == '}')
+	m = kMangledRightBrace;
       else if (c == ',')
 	m = kMangledComma;
       else if (c == ':')
diff --git a/gcc/rust/backend/rust-tree.h b/gcc/rust/backend/rust-tree.h
index 41dd012bd6d..284fd873c1c 100644
--- a/gcc/rust/backend/rust-tree.h
+++ b/gcc/rust/backend/rust-tree.h
@@ -82,6 +82,11 @@
 #define SLICE_TYPE_P(TYPE)                                                     \
   (TREE_CODE (TYPE) == RECORD_TYPE && TREE_LANG_FLAG_0 (TYPE))
 
+// lambda?
+#define RS_CLOSURE_FLAG TREE_LANG_FLAG_1
+#define RS_CLOSURE_TYPE_P(TYPE)                                                \
+  (TREE_CODE (TYPE) == RECORD_TYPE && TREE_LANG_FLAG_1 (TYPE))
+
 /* Returns true if NODE is a pointer to member function type.  */
 #define TYPE_PTRMEMFUNC_P(NODE)                                                \
   (TREE_CODE (NODE) == RECORD_TYPE && TYPE_PTRMEMFUNC_FLAG (NODE))
diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyty.cc
index 0d96c0f04fd..bdb2d909b86 100644
--- a/gcc/rust/typecheck/rust-tyty.cc
+++ b/gcc/rust/typecheck/rust-tyty.cc
@@ -1696,8 +1696,17 @@ ClosureType::can_eq (const BaseType *other, bool emit_errors) const
 bool
 ClosureType::is_equal (const BaseType &other) const
 {
-  gcc_unreachable ();
-  return false;
+  if (other.get_kind () != TypeKind::CLOSURE)
+    return false;
+
+  const ClosureType &other2 = static_cast<const ClosureType &> (other);
+  if (get_def_id () != other2.get_def_id ())
+    return false;
+
+  if (!get_parameters ().is_equal (other2.get_parameters ()))
+    return false;
+
+  return get_result_type ().is_equal (other2.get_result_type ());
 }
 
 BaseType *
diff --git a/gcc/testsuite/rust/execute/torture/closure1.rs b/gcc/testsuite/rust/execute/torture/closure1.rs
new file mode 100644
index 00000000000..62afa78a038
--- /dev/null
+++ b/gcc/testsuite/rust/execute/torture/closure1.rs
@@ -0,0 +1,18 @@
+extern "C" {
+    fn printf(s: *const i8, ...);
+}
+
+#[lang = "fn_once"]
+pub trait FnOnce<Args> {
+    #[lang = "fn_once_output"]
+    type Output;
+
+    extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
+}
+
+fn main() -> i32 {
+    let closure_annotated = |i: i32| -> i32 { i + 1 };
+
+    let i = 1;
+    closure_annotated(i) - 2
+}
-- 
2.39.1


  parent reply	other threads:[~2023-02-21 12:04 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 12:00 Rust front-end update arthur.cohen
2023-02-21 12:00 ` [committed 001/103] gccrs: Fix missing dead code analysis ICE on local enum definition arthur.cohen
2023-02-21 12:00 ` [committed 002/103] gccrs: visibility: Rename get_public_vis_type -> get_vis_type arthur.cohen
2023-02-21 12:00 ` [committed 003/103] gccrs: dump: Emit visibility when dumping items arthur.cohen
2023-02-21 12:53   ` Update copyright years. (was: [committed 003/103] gccrs: dump: Emit visibility when dumping items) Thomas Schwinge
2023-02-21 12:00 ` [committed 004/103] gccrs: Add catch for recusive type queries arthur.cohen
2023-02-21 12:00 ` [committed 005/103] gccrs: testing: try loop in const function arthur.cohen
2023-02-21 12:00 ` [committed 006/103] gccrs: ast: dump assignment and compound assignment expr arthur.cohen
2023-02-21 12:00 ` [committed 007/103] gccrs: ast: dump If expressions arthur.cohen
2023-02-21 12:00 ` [committed 008/103] gccrs: builtins: Move implementation into source file arthur.cohen
2023-02-21 12:00 ` [committed 009/103] gccrs: Track DefId on ADT variants arthur.cohen
2023-02-21 12:01 ` [committed 010/103] gccrs: Ensure uniqueness on Path probe's arthur.cohen
2023-02-21 12:01 ` [committed 011/103] gccrs: Support looking up super traits for trait items arthur.cohen
2023-02-21 12:01 ` [committed 012/103] gccrs: ast: dump: add emit_generic_params helper arthur.cohen
2023-02-21 12:01 ` [committed 013/103] gccrs: ast: dump: add format_{tuple,struct}_field helpers arthur.cohen
2023-02-21 12:01 ` [committed 014/103] gccrs: ast: dump structs, enums and unions arthur.cohen
2023-02-21 12:01 ` [committed 015/103] gccrs: intrinsics: Add data prefetching intrinsics arthur.cohen
2023-02-21 12:01 ` [committed 016/103] gccrs: fix ICE on missing closing paren arthur.cohen
2023-02-21 12:01 ` [committed 017/103] gccrs: mappings: Add MacroInvocation -> MacroRulesDef mappings arthur.cohen
2023-02-21 12:01 ` [committed 018/103] gccrs: rust-ast-resolve-item: Add note about resolving glob uses arthur.cohen
2023-02-21 12:01 ` [committed 019/103] gccrs: ast: Add accept_vis() method to `GenericArg` arthur.cohen
2023-02-21 12:01 ` [committed 020/103] gccrs: early-name-resolver: Add simple macro name resolution arthur.cohen
2023-02-21 12:01 ` [committed 021/103] gccrs: Support type resolution on super traits on dyn objects arthur.cohen
2023-02-21 12:01 ` [committed 022/103] gccrs: Add mappings for fn_once lang item arthur.cohen
2023-02-21 12:01 ` [committed 023/103] gccrs: Add ABI mappings for rust-call to map to ABI::RUST arthur.cohen
2023-02-21 12:01 ` [committed 024/103] gccrs: Method resolution must support multiple candidates arthur.cohen
2023-02-21 12:01 ` [committed 025/103] gccrs: ast: dump: fix extra newline in block without tail arthur.cohen
2023-02-21 12:01 ` [committed 026/103] gccrs: ast: dump: minor fixups to IfExpr formatting arthur.cohen
2023-02-21 12:01 ` [committed 027/103] gccrs: ast: dump: ComparisonExpr and LazyBooleanExpr arthur.cohen
2023-02-21 12:01 ` [committed 028/103] gccrs: ast: dump: ArrayExpr arthur.cohen
2023-02-21 12:01 ` [committed 029/103] gccrs: ast: dump: various simple Exprs arthur.cohen
2023-02-21 12:01 ` [committed 030/103] gccrs: ast: dump: RangeExprs arthur.cohen
2023-02-21 12:01 ` [committed 031/103] gccrs: Refactor TraitResolver to not require a visitor arthur.cohen
2023-02-21 12:01 ` [committed 032/103] gccrs: ast: dump TypeAlias arthur.cohen
2023-02-21 12:01 ` [committed 033/103] gccrs: Support outer attribute handling on trait items just like normal items arthur.cohen
2023-02-21 12:01 ` [committed 034/103] gccrs: dump: Emit visibility when dumping items arthur.cohen
2023-02-23  1:01   ` Gerald Pfeifer
2023-02-23 10:53     ` Arthur Cohen
2023-02-21 12:01 ` [committed 035/103] gccrs: dump: Dump items within modules arthur.cohen
2023-02-21 12:01 ` [committed 036/103] gccrs: dump: Fix module dumping arthur.cohen
2023-02-21 12:01 ` [committed 037/103] gccrs: ast: Module: unloaded module and inner attributes arthur.cohen
2023-02-21 12:01 ` [committed 038/103] gccrs: dump: Dump macro rules definition arthur.cohen
2023-02-21 12:01 ` [committed 039/103] gccrs: Add check for recursive trait cycles arthur.cohen
2023-02-21 12:01 ` [committed 040/103] gccrs: ast: Refactor ASTFragment -> Fragment class arthur.cohen
2023-02-21 12:01 ` [committed 041/103] gccrs: rust: Replace uses of ASTFragment -> Fragment arthur.cohen
2023-02-21 12:01 ` [committed 042/103] gccrs: ast: Improve Fragment API arthur.cohen
2023-02-21 12:01 ` [committed 043/103] gccrs: Add missing fn_once_output langitem arthur.cohen
2023-02-21 12:01 ` [committed 044/103] gccrs: Refactor expression hir lowering into cc file arthur.cohen
2023-02-21 12:01 ` [committed 045/103] gccrs: Formatting cleanup in HIR lowering pattern arthur.cohen
2023-02-21 12:01 ` [committed 046/103] gccrs: Add name resolution for closures arthur.cohen
2023-02-21 12:01 ` [committed 047/103] gccrs: Refactor method call type checking arthur.cohen
2023-02-21 12:01 ` [committed 048/103] gccrs: Add closures to lints and error checking arthur.cohen
2023-02-21 12:01 ` [committed 049/103] gccrs: Initial Type resolution for closures arthur.cohen
2023-02-21 12:01 ` arthur.cohen [this message]
2023-02-21 12:01 ` [committed 051/103] gccrs: Add missing name resolution to Function type-path segments arthur.cohen
2023-02-21 12:01 ` [committed 052/103] gccrs: Add missing hir lowering to function " arthur.cohen
2023-02-21 12:01 ` [committed 053/103] gccrs: Add missing type resolution for function type segments arthur.cohen
2023-02-21 12:01 ` [committed 054/103] gccrs: Support Closure calls as generic trait bounds arthur.cohen
2023-02-21 12:01 ` [committed 055/103] gccrs: Implement the inline visitor arthur.cohen
2023-02-21 12:01 ` [committed 056/103] gccrs: rust: Allow gccrs to build on x86_64-apple-darwin with clang/libc++ arthur.cohen
2023-02-21 12:01 ` [committed 057/103] gccrs: builtins: Rename all bang macro handlers arthur.cohen
2023-02-21 12:01 ` [committed 058/103] gccrs: intrinsics: Add `sorry_handler` intrinsic handler arthur.cohen
2023-02-21 12:01 ` [committed 059/103] gccrs: constexpr: Add `rust_sorry_at` in places relying on init values arthur.cohen
2023-02-21 12:01 ` [committed 060/103] gccrs: intrinsics: Add early implementation for atomic_store_{seqcst, relaxed, release} arthur.cohen
2023-02-21 12:01 ` [committed 061/103] gccrs: intrinsics: Add unchecked operation intrinsics arthur.cohen
2023-02-21 12:01 ` [committed 062/103] gccrs: intrinsics: Use lambdas for wrapping_<op> intrinsics arthur.cohen
2023-02-21 12:01 ` [committed 063/103] gccrs: intrinsics: Cleanup error handling around atomic_store_* arthur.cohen
2023-02-21 12:01 ` [committed 064/103] gccrs: intrinsics: Implement atomic_load intrinsics arthur.cohen
2023-02-21 12:01 ` [committed 065/103] gccrs: ast: visitor pattern -> overload syntax compatibility layer arthur.cohen
2023-02-21 12:01 ` [committed 066/103] gccrs: ast: transform helper methods to visits and add methods to simplify repeated patterns arthur.cohen
2023-02-21 12:01 ` [committed 067/103] gccrs: ast: refer correctly to arguments in docs-strings arthur.cohen
2023-02-21 12:01 ` [committed 068/103] gccrs: ast: Dump unit struct arthur.cohen
2023-02-21 12:01 ` [committed 069/103] gccrs: add lang item "phantom_data" arthur.cohen
2023-02-21 12:02 ` [committed 070/103] gccrs: add Location to AST::Visibility arthur.cohen
2023-02-21 12:02 ` [committed 071/103] gccrs: typecheck: Fix overzealous `delete` call arthur.cohen
2023-02-21 12:02 ` [committed 072/103] gccrs: ast: add visit overload for references arthur.cohen
2023-02-21 12:02 ` [committed 073/103] gccrs: ast: Dump where clause and recursively needed nodes arthur.cohen
2023-02-21 12:02 ` [committed 074/103] gccrs: ast: Dump slice type arthur.cohen
2023-02-21 12:02 ` [committed 075/103] gccrs: ast: Dump array type arthur.cohen
2023-02-21 12:02 ` [committed 076/103] gccrs: ast: Dump raw pointer type arthur.cohen
2023-02-21 12:02 ` [committed 077/103] gccrs: ast: Dump never type arthur.cohen
2023-02-21 12:02 ` [committed 078/103] gccrs: ast: Dump tuple type arthur.cohen
2023-02-21 12:02 ` [committed 079/103] gccrs: ast: Dump inferred type arthur.cohen
2023-02-21 12:02 ` [committed 080/103] gccrs: ast: Dump bare function type arthur.cohen
2023-02-21 12:02 ` [committed 081/103] gccrs: ast: Dump impl trait type one bound arthur.cohen
2023-02-21 12:02 ` [committed 082/103] gccrs: ast: Dump impl trait type arthur.cohen
2023-02-21 12:02 ` [committed 083/103] gccrs: ast: Dump trait object type arthur.cohen
2023-02-21 12:02 ` [committed 084/103] gccrs: ast: Dump parenthesised type arthur.cohen
2023-02-21 12:02 ` [committed 085/103] gccrs: ast: Dump trait object type one bound arthur.cohen
2023-02-21 12:02 ` [committed 086/103] gccrs: ast: Dump type param type arthur.cohen
2023-02-21 12:02 ` [committed 087/103] gccrs: ast: Dump generic parameters arthur.cohen
2023-02-21 12:02 ` [committed 088/103] gccrs: ast: Remove unused include in rust-ast-dump.cc arthur.cohen
2023-02-21 12:02 ` [committed 089/103] gccrs: ast: Dump remove /* stmp */ comment to not clutter the dump arthur.cohen
2023-02-21 12:02 ` [committed 090/103] gccrs: ast: Dump no comma after self in fn params if it is the last one arthur.cohen
2023-02-21 12:02 ` [committed 091/103] gccrs: Remove default location. Add visibility location to create_* functions arthur.cohen
2023-02-21 12:02 ` [committed 092/103] gccrs: Improve lexer dump arthur.cohen
2023-02-21 12:02 ` [committed 093/103] gccrs: Get rid of make builtin macro arthur.cohen
2023-02-21 12:02 ` [committed 094/103] gccrs: Refactor name resolver to take a Rib::ItemType arthur.cohen
2023-02-21 12:02 ` [committed 095/103] gccrs: Add closure binding's tracking to name resolution arthur.cohen
2023-02-21 12:02 ` [committed 096/103] gccrs: Add capture tracking to the type info for closures arthur.cohen
2023-02-21 12:02 ` [committed 097/103] gccrs: Add initial support for argument capture of closures arthur.cohen
2023-02-21 12:02 ` [committed 098/103] gccrs: Fix undefined behaviour issues on macos arthur.cohen
2023-02-21 12:02 ` [committed 099/103] gccrs: Skip this debug test case which is failing on the latest mac-os devtools and its only for debug info arthur.cohen
2023-02-21 12:02 ` [committed 100/103] gccrs: Cleanup unused parameters to fix the bootstrap build arthur.cohen
2023-02-21 12:02 ` [committed 101/103] gccrs: Repair 'gcc/rust/lang.opt' comment arthur.cohen
2023-02-21 12:02 ` [committed 102/103] gccrs: const evaluator: Remove get_nth_callarg arthur.cohen
2023-02-21 12:02 ` [committed 103/103] gccrs: add math intrinsics arthur.cohen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230221120230.596966-51-arthur.cohen@embecosm.com \
    --to=arthur.cohen@embecosm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc-rust@gcc.gnu.org \
    --cc=philip.herron@embecosm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).