From: Arthur Cohen <arthur.cohen@embecosm.com>
To: gcc-patches@gcc.gnu.org
Cc: gcc-rust@gcc.gnu.org, Arthur Cohen <arthur.cohen@embecosm.com>
Subject: [PATCH 013/125] gccrs: libformat_parser: Update header and remove old interface
Date: Thu, 1 Aug 2024 16:56:09 +0200 [thread overview]
Message-ID: <20240801145809.366388-15-arthur.cohen@embecosm.com> (raw)
In-Reply-To: <20240801145809.366388-2-arthur.cohen@embecosm.com>
gcc/rust/ChangeLog:
* ast/rust-fmt.cc (Pieces::collect): Use new Pieces API.
* ast/rust-fmt.h: Update interface with new FFI bindings.
libgrust/ChangeLog:
* libformat_parser/src/lib.rs: Add IntoFFI trait.
* libformat_parser/libformat-parser.h: Removed.
---
gcc/rust/ast/rust-fmt.cc | 10 +-
gcc/rust/ast/rust-fmt.h | 199 ++++++++++++----
libgrust/libformat_parser/libformat-parser.h | 224 -------------------
libgrust/libformat_parser/src/lib.rs | 56 +++--
4 files changed, 200 insertions(+), 289 deletions(-)
delete mode 100644 libgrust/libformat_parser/libformat-parser.h
diff --git a/gcc/rust/ast/rust-fmt.cc b/gcc/rust/ast/rust-fmt.cc
index 559b1c8b579..a7c4341c52d 100644
--- a/gcc/rust/ast/rust-fmt.cc
+++ b/gcc/rust/ast/rust-fmt.cc
@@ -17,6 +17,7 @@
// <http://www.gnu.org/licenses/>.
#include "rust-fmt.h"
+#include "rust-diagnostics.h"
namespace Rust {
namespace Fmt {
@@ -26,13 +27,12 @@ Pieces::collect (const std::string &to_parse)
{
auto piece_slice = collect_pieces (to_parse.c_str ());
- rust_debug ("[ARTHUR] %p, %lu", (void *) piece_slice.ptr, piece_slice.len);
+ rust_debug ("[ARTHUR] %p, %lu", (const void *) piece_slice.base_ptr,
+ piece_slice.len);
// this performs multiple copies, can we avoid them maybe?
- auto pieces
- = std::vector (piece_slice.ptr, piece_slice.ptr + piece_slice.len);
-
- rust_debug ("[ARTHUR] %p, %lu", (void *) pieces.data (), pieces.size ());
+ // auto pieces = std::vector<Piece> (piece_slice.base_ptr,
+ // piece_slice.base_ptr + piece_slice.len);
return Pieces{};
}
diff --git a/gcc/rust/ast/rust-fmt.h b/gcc/rust/ast/rust-fmt.h
index 27c1c3625d3..7ec9a2a199d 100644
--- a/gcc/rust/ast/rust-fmt.h
+++ b/gcc/rust/ast/rust-fmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2020-2023 Free Software Foundation, Inc.
+// Copyright (C) 2023-2024 Free Software Foundation, Inc.
// This file is part of GCC.
@@ -19,9 +19,10 @@
#ifndef RUST_FMT_H
#define RUST_FMT_H
-#include "rust-diagnostics.h"
#include "rust-system.h"
+// FIXME: How to encode Option?
+
namespace Rust {
namespace Fmt {
@@ -30,116 +31,220 @@ struct RustHamster
// hehe
};
-struct InnerSpan
+/// Enum of alignments which are supported.
+enum class Alignment
{
+ /// The value will be aligned to the left.
+ AlignLeft,
+ /// The value will be aligned to the right.
+ AlignRight,
+ /// The value will be aligned in the center.
+ AlignCenter,
+ /// The value will take on a default alignment.
+ AlignUnknown,
};
-struct Count
+/// Enum for the debug hex flags.
+enum class DebugHex
{
- enum class Kind
- {
- Is,
- IsName,
- IsParam,
- IsStar,
- Implied
- } kind;
-
- union
- {
- size_t is;
- std::pair<RustHamster, InnerSpan> is_name;
- size_t is_param;
- size_t is_star;
- } data;
+ /// The `x` flag in `{:x?}`.
+ Lower,
+ /// The `X` flag in `{:X?}`.
+ Upper,
};
-struct DebugHex
+/// Enum for the sign flags.
+enum class Sign
{
+ /// The `+` flag.
+ Plus,
+ /// The `-` flag.
+ Minus,
};
-struct Sign
+/// Enum describing where an argument for a format can be located.
+struct Position
{
-};
+ enum class Tag
+ {
+ /// The argument is implied to be located at an index
+ ArgumentImplicitlyIs,
+ /// The argument is located at a specific index given in the format,
+ ArgumentIs,
+ /// The argument has a name.
+ ArgumentNamed,
+ };
-struct Alignment
-{
+ struct ArgumentImplicitlyIs_Body
+ {
+ size_t _0;
+ };
+
+ struct ArgumentIs_Body
+ {
+ size_t _0;
+ };
+
+ struct ArgumentNamed_Body
+ {
+ RustHamster _0;
+ };
+
+ Tag tag;
+ union
+ {
+ ArgumentImplicitlyIs_Body argument_implicitly_is;
+ ArgumentIs_Body argument_is;
+ ArgumentNamed_Body argument_named;
+ };
};
-struct RustString
+/// Range inside of a `Span` used for diagnostics when we only have access to
+/// relative positions.
+struct InnerSpan
{
- // hehe
+ size_t start;
+ size_t end;
};
-struct Position
+/// A count is used for the precision and width parameters of an integer, and
+/// can reference either an argument or a literal integer.
+struct Count
{
+ enum class Tag
+ {
+ /// The count is specified explicitly.
+ CountIs,
+ /// The count is specified by the argument with the given name.
+ CountIsName,
+ /// The count is specified by the argument at the given index.
+ CountIsParam,
+ /// The count is specified by a star (like in `{:.*}`) that refers to the
+ /// argument at the given index.
+ CountIsStar,
+ /// The count is implied and cannot be explicitly specified.
+ CountImplied,
+ };
+
+ struct CountIs_Body
+ {
+ size_t _0;
+ };
+
+ struct CountIsName_Body
+ {
+ RustHamster _0;
+ InnerSpan _1;
+ };
+
+ struct CountIsParam_Body
+ {
+ size_t _0;
+ };
+
+ struct CountIsStar_Body
+ {
+ size_t _0;
+ };
+
+ Tag tag;
+ union
+ {
+ CountIs_Body count_is;
+ CountIsName_Body count_is_name;
+ CountIsParam_Body count_is_param;
+ CountIsStar_Body count_is_star;
+ };
};
+/// Specification for the formatting of an argument in the format string.
struct FormatSpec
{
/// Optionally specified character to fill alignment with.
- tl::optional<char /* FIXME: This is a Rust char, not a C++ char - use an uint32_t instead? */> fill;
+ const uint32_t *fill;
/// Span of the optionally specified fill character.
- tl::optional<InnerSpan> fill_span;
+ const InnerSpan *fill_span;
/// Optionally specified alignment.
Alignment align;
/// The `+` or `-` flag.
- tl::optional<Sign> sign;
+ const Sign *sign;
/// The `#` flag.
bool alternate;
/// The `0` flag.
bool zero_pad;
/// The `x` or `X` flag. (Only for `Debug`.)
- tl::optional<DebugHex> debug_hex;
+ const DebugHex *debug_hex;
/// The integer precision to use.
Count precision;
/// The span of the precision formatting flag (for diagnostics).
- tl::optional<InnerSpan> precision_span;
+ const InnerSpan *precision_span;
/// The string width requested for the resulting format.
Count width;
/// The span of the width formatting flag (for diagnostics).
- tl::optional<InnerSpan> width_span;
+ const InnerSpan *width_span;
/// The descriptor string representing the name of the format desired for
/// this argument, this can be empty or any number of characters, although
/// it is required to be one word.
RustHamster ty;
- // &'a str ty;
/// The span of the descriptor string (for diagnostics).
- tl::optional<InnerSpan> ty_span;
+ const InnerSpan *ty_span;
};
+/// Representation of an argument specification.
struct Argument
{
+ /// Where to find this argument
Position position;
- InnerSpan inner_span;
+ /// The span of the position indicator. Includes any whitespace in implicit
+ /// positions (`{ }`).
+ InnerSpan position_span;
+ /// How to format the argument
FormatSpec format;
};
+/// A piece is a portion of the format string which represents the next part
+/// to emit. These are emitted as a stream by the `Parser` class.
struct Piece
{
- enum class Kind
+ enum class Tag
{
+ /// A literal string which should directly be emitted
String,
- NextArgument
- } kind;
+ /// This describes that formatting should process the next argument (as
+ /// specified inside) for emission.
+ NextArgument,
+ };
+
+ struct String_Body
+ {
+ RustHamster _0;
+ };
+
+ struct NextArgument_Body
+ {
+ const Argument *_0;
+ };
+ Tag tag;
union
{
- RustString string;
- Argument *next_argument;
- } data;
+ String_Body string;
+ NextArgument_Body next_argument;
+ };
};
struct PieceSlice
{
- Piece *ptr;
+ const Piece *base_ptr;
size_t len;
};
extern "C" {
+
PieceSlice
-collect_pieces (const char *);
-}
+collect_pieces (const char *input);
+
+} // extern "C"
struct Pieces
{
@@ -149,4 +254,4 @@ struct Pieces
} // namespace Fmt
} // namespace Rust
-#endif // ! RUST_FMT_H
+#endif // !RUST_FMT_H
diff --git a/libgrust/libformat_parser/libformat-parser.h b/libgrust/libformat_parser/libformat-parser.h
deleted file mode 100644
index a4bc8a75494..00000000000
--- a/libgrust/libformat_parser/libformat-parser.h
+++ /dev/null
@@ -1,224 +0,0 @@
-#include <cstdarg>
-#include <cstdint>
-#include <cstdlib>
-#include <ostream>
-#include <new>
-
-/// Enum of alignments which are supported.
-enum class Alignment
-{
- /// The value will be aligned to the left.
- AlignLeft,
- /// The value will be aligned to the right.
- AlignRight,
- /// The value will be aligned in the center.
- AlignCenter,
- /// The value will take on a default alignment.
- AlignUnknown,
-};
-
-/// Enum for the debug hex flags.
-enum class DebugHex
-{
- /// The `x` flag in `{:x?}`.
- Lower,
- /// The `X` flag in `{:X?}`.
- Upper,
-};
-
-/// Enum for the sign flags.
-enum class Sign
-{
- /// The `+` flag.
- Plus,
- /// The `-` flag.
- Minus,
-};
-
-template <typename T = void> struct Box;
-
-template <typename T = void> struct Option;
-
-/// Enum describing where an argument for a format can be located.
-struct Position
-{
- enum class Tag
- {
- /// The argument is implied to be located at an index
- ArgumentImplicitlyIs,
- /// The argument is located at a specific index given in the format,
- ArgumentIs,
- /// The argument has a name.
- ArgumentNamed,
- };
-
- struct ArgumentImplicitlyIs_Body
- {
- uintptr_t _0;
- };
-
- struct ArgumentIs_Body
- {
- uintptr_t _0;
- };
-
- struct ArgumentNamed_Body
- {
- const str *_0;
- };
-
- Tag tag;
- union
- {
- ArgumentImplicitlyIs_Body argument_implicitly_is;
- ArgumentIs_Body argument_is;
- ArgumentNamed_Body argument_named;
- };
-};
-
-/// Range inside of a `Span` used for diagnostics when we only have access to
-/// relative positions.
-struct InnerSpan
-{
- uintptr_t start;
- uintptr_t end;
-};
-
-/// A count is used for the precision and width parameters of an integer, and
-/// can reference either an argument or a literal integer.
-struct Count
-{
- enum class Tag
- {
- /// The count is specified explicitly.
- CountIs,
- /// The count is specified by the argument with the given name.
- CountIsName,
- /// The count is specified by the argument at the given index.
- CountIsParam,
- /// The count is specified by a star (like in `{:.*}`) that refers to the
- /// argument at the given index.
- CountIsStar,
- /// The count is implied and cannot be explicitly specified.
- CountImplied,
- };
-
- struct CountIs_Body
- {
- uintptr_t _0;
- };
-
- struct CountIsName_Body
- {
- const str *_0;
- InnerSpan _1;
- };
-
- struct CountIsParam_Body
- {
- uintptr_t _0;
- };
-
- struct CountIsStar_Body
- {
- uintptr_t _0;
- };
-
- Tag tag;
- union
- {
- CountIs_Body count_is;
- CountIsName_Body count_is_name;
- CountIsParam_Body count_is_param;
- CountIsStar_Body count_is_star;
- };
-};
-
-/// Specification for the formatting of an argument in the format string.
-struct FormatSpec
-{
- /// Optionally specified character to fill alignment with.
- Option<uint32_t> fill;
- /// Span of the optionally specified fill character.
- Option<InnerSpan> fill_span;
- /// Optionally specified alignment.
- Alignment align;
- /// The `+` or `-` flag.
- Option<Sign> sign;
- /// The `#` flag.
- bool alternate;
- /// The `0` flag.
- bool zero_pad;
- /// The `x` or `X` flag. (Only for `Debug`.)
- Option<DebugHex> debug_hex;
- /// The integer precision to use.
- Count precision;
- /// The span of the precision formatting flag (for diagnostics).
- Option<InnerSpan> precision_span;
- /// The string width requested for the resulting format.
- Count width;
- /// The span of the width formatting flag (for diagnostics).
- Option<InnerSpan> width_span;
- /// The descriptor string representing the name of the format desired for
- /// this argument, this can be empty or any number of characters, although
- /// it is required to be one word.
- const str *ty;
- /// The span of the descriptor string (for diagnostics).
- Option<InnerSpan> ty_span;
-};
-
-/// Representation of an argument specification.
-struct Argument
-{
- /// Where to find this argument
- Position position;
- /// The span of the position indicator. Includes any whitespace in implicit
- /// positions (`{ }`).
- InnerSpan position_span;
- /// How to format the argument
- FormatSpec format;
-};
-
-/// A piece is a portion of the format string which represents the next part
-/// to emit. These are emitted as a stream by the `Parser` class.
-struct Piece
-{
- enum class Tag
- {
- /// A literal string which should directly be emitted
- String,
- /// This describes that formatting should process the next argument (as
- /// specified inside) for emission.
- NextArgument,
- };
-
- struct String_Body
- {
- const str *_0;
- };
-
- struct NextArgument_Body
- {
- Box<Argument> _0;
- };
-
- Tag tag;
- union
- {
- String_Body string;
- NextArgument_Body next_argument;
- };
-};
-
-struct PieceSlice
-{
- const Piece *base_ptr;
- uintptr_t len;
-};
-
-extern "C" {
-
-PieceSlice
-collect_pieces (const char *input);
-
-} // extern "C"
diff --git a/libgrust/libformat_parser/src/lib.rs b/libgrust/libformat_parser/src/lib.rs
index 49821e7cd2f..4bbc468c755 100644
--- a/libgrust/libformat_parser/src/lib.rs
+++ b/libgrust/libformat_parser/src/lib.rs
@@ -5,8 +5,31 @@
use std::ffi::CStr;
+trait IntoFFI {
+ type Output;
+
+ fn into_ffi(&self) -> Self::Output;
+}
+
+impl<T> IntoFFI for Option<T>
+where
+ T: Sized,
+{
+ type Output = *const T;
+
+ fn into_ffi(&self) -> Self::Output {
+ match self.as_ref() {
+ None => std::ptr::null(),
+ Some(r) => r as *const T,
+ }
+ }
+}
+
+// FIXME: Make an ffi module in a separate file
+// FIXME: Remember to leak the boxed type somehow
+// FIXME: How to encode the Option type? As a pointer? Option<T> -> Option<&T> -> *const T could work maybe?
mod ffi {
- use std::ops::Deref;
+ use super::IntoFFI;
// Note: copied from rustc_span
/// Range inside of a `Span` used for diagnostics when we only have access to relative positions.
@@ -102,31 +125,31 @@ mod ffi {
/// Optionally specified character to fill alignment with.
pub fill: Option<char>,
/// Span of the optionally specified fill character.
- pub fill_span: Option<InnerSpan>,
+ pub fill_span: *const InnerSpan,
/// Optionally specified alignment.
pub align: Alignment,
/// The `+` or `-` flag.
- pub sign: Option<Sign>,
+ pub sign: *const Sign,
/// The `#` flag.
pub alternate: bool,
/// The `0` flag.
pub zero_pad: bool,
/// The `x` or `X` flag. (Only for `Debug`.)
- pub debug_hex: Option<DebugHex>,
+ pub debug_hex: *const DebugHex,
/// The integer precision to use.
pub precision: Count<'a>,
/// The span of the precision formatting flag (for diagnostics).
- pub precision_span: Option<InnerSpan>,
+ pub precision_span: *const InnerSpan,
/// The string width requested for the resulting format.
pub width: Count<'a>,
/// The span of the width formatting flag (for diagnostics).
- pub width_span: Option<InnerSpan>,
+ pub width_span: *const InnerSpan,
/// The descriptor string representing the name of the format desired for
/// this argument, this can be empty or any number of characters, although
/// it is required to be one word.
pub ty: &'a str,
/// The span of the descriptor string (for diagnostics).
- pub ty_span: Option<InnerSpan>,
+ pub ty_span: *const InnerSpan,
}
/// Enum describing where an argument for a format can be located.
@@ -197,6 +220,11 @@ mod ffi {
match old {
generic_format_parser::Piece::String(x) => Piece::String(x),
generic_format_parser::Piece::NextArgument(x) => {
+ // FIXME: This is problematic - if we do this, then we probably run into the issue that the Box
+ // is freed at the end of the call to collect_pieces. if we just .leak() it, then we have
+ // a memory leak... should we resend the info back to the Rust lib afterwards to free it?
+ // this is definitely the best way - store that pointer in the FFI piece and rebuild the box
+ // in a Rust destructor
Piece::NextArgument(Box::new(Into::<Argument>::into(*x)))
}
}
@@ -240,18 +268,18 @@ mod ffi {
fn from(old: generic_format_parser::FormatSpec<'a>) -> Self {
FormatSpec {
fill: old.fill,
- fill_span: old.fill_span.map(Into::into),
+ fill_span: old.fill_span.map(Into::into).into_ffi(),
align: old.align.into(),
- sign: old.sign.map(Into::into),
+ sign: old.sign.map(Into::into).into_ffi(),
alternate: old.alternate,
zero_pad: old.zero_pad,
- debug_hex: old.debug_hex.map(Into::into),
+ debug_hex: old.debug_hex.map(Into::into).into_ffi(),
precision: old.precision.into(),
- precision_span: old.precision_span.map(Into::into),
+ precision_span: old.precision_span.map(Into::into).into_ffi(),
width: old.width.into(),
- width_span: old.width_span.map(Into::into),
+ width_span: old.width_span.map(Into::into).into_ffi(),
ty: old.ty,
- ty_span: old.ty_span.map(Into::into),
+ ty_span: old.ty_span.map(Into::into).into_ffi(),
}
}
}
@@ -327,6 +355,8 @@ pub extern "C" fn collect_pieces(input: *const libc::c_char) -> PieceSlice {
.map(Into::into)
.collect();
+ println!("debug: {:?}, {:?}", pieces.as_ptr(), pieces.len());
+
PieceSlice {
base_ptr: pieces.as_ptr(),
len: pieces.len(),
--
2.45.2
next prev parent reply other threads:[~2024-08-01 14:58 UTC|newest]
Thread overview: 130+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-01 14:55 [PATCH 001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work Arthur Cohen
2024-08-01 14:55 ` [PATCH 002/125] gccrs: Fix false positive for top-level AltPattern Arthur Cohen
2024-08-01 14:55 ` [PATCH 003/125] gccrs: minor cleanup in langhook.type_for_mode Arthur Cohen
2024-08-01 14:56 ` [PATCH 004/125] gccrs: fmt: Start working on format_args!() parser Arthur Cohen
2024-08-01 14:56 ` [PATCH 005/125] gccrs: libgrust: Add format_parser library Arthur Cohen
2024-08-05 8:18 ` Don't override 'LIBS' if '--enable-languages=rust'; use 'CRAB1_LIBS' (was: [PATCH 005/125] gccrs: libgrust: Add format_parser library) Thomas Schwinge
2024-11-23 20:09 ` Rust: Work around 'error[E0658]: `let...else` statements are unstable' " Thomas Schwinge
2024-11-25 10:24 ` Rust: Work around 'error[E0658]: `let...else` statements are unstable' Arthur Cohen
2024-08-01 14:56 ` [PATCH 006/125] gccrs: Add 'gcc/rust/Make-lang.in:LIBFORMAT_PARSER' Arthur Cohen
2024-08-05 8:45 ` Inline 'gcc/rust/Make-lang.in:RUST_LIBDEPS' (was: [PATCH 006/125] gccrs: Add 'gcc/rust/Make-lang.in:LIBFORMAT_PARSER') Thomas Schwinge
2024-08-01 14:56 ` [PATCH 007/125] gccrs: libgrust: Vendor Rust dependencies Arthur Cohen
2024-08-01 14:56 ` [PATCH 008/125] Rust: Don't cache 'libformat_parser.a' Arthur Cohen
2024-08-01 14:56 ` [PATCH 009/125] Rust: Move 'libformat_parser' build into the GCC build directory Arthur Cohen
2024-08-01 14:56 ` [PATCH 010/125] Rust: Move 'libformat_parser' build into libgrust Arthur Cohen
2024-08-01 14:56 ` [PATCH 011/125] gccrs: libformat_parser: Add FFI safe interface Arthur Cohen
2024-08-01 14:56 ` [PATCH 012/125] gccrs: libformat_parser: Start experimenting with cbindgen Arthur Cohen
2024-08-01 14:56 ` Arthur Cohen [this message]
2024-08-01 14:56 ` [PATCH 014/125] gccrs: libformat_parser: Send boxed values across FFI properly Arthur Cohen
2024-08-01 14:56 ` [PATCH 015/125] gccrs: format_args: Parse format string properly Arthur Cohen
2024-08-01 14:56 ` [PATCH 016/125] gccrs: format_args: Parse entire token invocation Arthur Cohen
2024-08-01 14:56 ` [PATCH 017/125] gccrs: rust-fmt: Store parsed string in Pieces struct Arthur Cohen
2024-08-01 14:56 ` [PATCH 018/125] gccrs: libformat_parser: Fix Rust warnings Arthur Cohen
2024-08-01 14:56 ` [PATCH 019/125] gccrs: format-parser: Add `is_some_and` method for Option<T> Arthur Cohen
2024-08-01 14:56 ` [PATCH 020/125] gccrs: Adjust error checks to match name resolution 2.0 Arthur Cohen
2024-08-01 14:56 ` [PATCH 021/125] gccrs: Fix small FixMe task in rust macro builtins Arthur Cohen
2024-08-01 14:56 ` [PATCH 022/125] gccrs: lang-items: Cleanup parsing and lookups of lang items Arthur Cohen
2024-08-01 14:56 ` [PATCH 023/125] gccrs: lang-items: Make lang items enum stronger, rename class, cleanup ns Arthur Cohen
2024-08-01 14:56 ` [PATCH 024/125] gccrs: extern-types: Declare external types in name resolver Arthur Cohen
2024-08-01 14:56 ` [PATCH 025/125] gccrs: hir: Add ExternalTypeItem node Arthur Cohen
2024-08-01 14:56 ` [PATCH 026/125] gccrs: extern-types: Lower to HIR::ExternalTypeItem properly Arthur Cohen
2024-08-01 14:56 ` [PATCH 027/125] gccrs: Make DefaultResolver visit more of the AST Arthur Cohen
2024-08-01 14:56 ` [PATCH 028/125] gccrs: ast: Add base nodes for FormatArgs Arthur Cohen
2024-08-01 14:56 ` [PATCH 029/125] gccrs: macro-builtins: Add newline generic format_args!() handler Arthur Cohen
2024-08-01 14:56 ` [PATCH 030/125] gccrs: parser: Add peek(n) method to parser Arthur Cohen
2024-08-01 14:56 ` [PATCH 031/125] gccrs: format-args: Fix Rust interface and add input parsing Arthur Cohen
2024-08-01 14:56 ` [PATCH 032/125] gccrs: lower: Add base for lowering FormatArgs nodes Arthur Cohen
2024-08-01 14:56 ` [PATCH 033/125] gccrs: format-args: Add documentation for future expansion of function Arthur Cohen
2024-08-01 14:56 ` [PATCH 034/125] gccrs: Add error emitting when we can't resolve id expr Arthur Cohen
2024-08-01 14:56 ` [PATCH 035/125] gccrs: Add curly brackets, formatted clang Arthur Cohen
2024-08-01 14:56 ` [PATCH 036/125] gccrs: Ensure TupleStructPattern and TuplePattern have items Arthur Cohen
2024-08-01 14:56 ` [PATCH 037/125] gccrs: Clean BiMap to use tl::optional for lookups Arthur Cohen
2024-08-01 14:56 ` [PATCH 038/125] gccrs: Add support for external functions Arthur Cohen
2024-08-01 14:56 ` [PATCH 039/125] gccrs: Add get_pattern_kind to Pattern Arthur Cohen
2024-08-01 14:56 ` [PATCH 040/125] gccrs: Unify ASTValidation::visit for ExternalFunctionItem and Function Arthur Cohen
2024-08-01 14:56 ` [PATCH 041/125] gccrs: Update resolver to use `AST::Function` instead of `AST::ExternalFunctionItem` Arthur Cohen
2024-08-01 14:56 ` [PATCH 042/125] gccrs: Remove dead code associated with `AST::ExternalFunctionItem` Arthur Cohen
2024-08-01 14:56 ` [PATCH 043/125] gccrs: Placate clang-format re 'gcc/rust/backend/rust-tree.cc' Arthur Cohen
2024-08-01 14:56 ` [PATCH 044/125] gccrs: Replace reference to unique pointer with reference Arthur Cohen
2024-08-01 14:56 ` [PATCH 045/125] gccrs: Replace unique_ptr references with references Arthur Cohen
2024-08-01 14:56 ` [PATCH 046/125] gccrs: macro: Use MacroInvocation's node_id in ExternalItem constructor Arthur Cohen
2024-08-01 14:56 ` [PATCH 047/125] gccrs: format-args: Add base for expanding FormatArgs nodes Arthur Cohen
2024-08-01 14:56 ` [PATCH 048/125] gccrs: format-args: Start storing string in Rust memory Arthur Cohen
2024-11-23 20:17 ` Rust: Work around 'error[E0599]: no method named `leak` found for struct `std::string::String` in the current scope' (was: [PATCH 048/125] gccrs: format-args: Start storing string in Rust memory) Thomas Schwinge
2024-08-01 14:56 ` [PATCH 049/125] gccrs: format-args: Add basic expansion of unnamed Display::fmt arguments Arthur Cohen
2024-08-01 14:56 ` [PATCH 050/125] gccrs: format-args: Add basic test case Arthur Cohen
2024-08-01 14:56 ` [PATCH 051/125] gccrs: format-args: Only pass the format string to the parser Arthur Cohen
2024-08-01 14:56 ` [PATCH 052/125] gccrs: TyTy: add common SubstitutionRef API Arthur Cohen
2024-08-01 14:56 ` [PATCH 053/125] gccrs: TyTy: Variance analysis module Arthur Cohen
2024-08-01 14:56 ` [PATCH 054/125] gccrs: TyTy: Collect variance info from types Arthur Cohen
2024-08-01 14:56 ` [PATCH 055/125] gccrs: Store visibility properly in ExternalTypeItem Arthur Cohen
2024-08-01 14:56 ` [PATCH 056/125] gccrs: Fix typo Arthur Cohen
2024-08-01 14:56 ` [PATCH 057/125] gccrs: Split up rust-macro-builtins.cc Arthur Cohen
2024-08-01 14:56 ` [PATCH 058/125] gccrs: Placate clang-format re 'gcc/rust/lex/rust-lex.cc' Arthur Cohen
2024-08-01 14:56 ` [PATCH 059/125] gccrs: nr2.0: Add new ImmutableNameResolutionCtx class Arthur Cohen
2024-08-01 14:56 ` [PATCH 060/125] gccrs: sesh: Add late name resolution 2.0 Arthur Cohen
2024-08-01 14:56 ` [PATCH 061/125] gccrs: session-manager: Dump name resolution pass Arthur Cohen
2024-08-01 14:56 ` [PATCH 062/125] gccrs: session manager: Init Immutable name resolver Arthur Cohen
2024-08-01 14:56 ` [PATCH 063/125] gccrs: nr2.0: Add lookup of resolved nodes Arthur Cohen
2024-08-01 14:57 ` [PATCH 064/125] gccrs: typecheck: Start using nr2.0 properly Arthur Cohen
2024-08-01 14:57 ` [PATCH 065/125] gccrs: backend: Use new name resolver where necessary Arthur Cohen
2024-08-01 14:57 ` [PATCH 066/125] gccrs: nr2.0: Start using newtype pattern for Usage and Declaration Arthur Cohen
2024-08-01 14:57 ` [PATCH 067/125] gccrs: late: Setup builtin types properly, change Rib API Arthur Cohen
2024-08-01 14:57 ` [PATCH 068/125] gccrs: Fix duplicate detection Arthur Cohen
2024-08-01 14:57 ` [PATCH 069/125] gccrs: Emit error on identical use declarations Arthur Cohen
2024-08-01 14:57 ` [PATCH 070/125] gccrs: Change error message on unresolved import Arthur Cohen
2024-08-01 14:57 ` [PATCH 071/125] gccrs: Prevent error emission on resolver reentry Arthur Cohen
2024-08-01 14:57 ` [PATCH 072/125] gccrs: late: Add bool builtin type Arthur Cohen
2024-08-01 14:57 ` [PATCH 073/125] gccrs: Add modules to type namespace Arthur Cohen
2024-08-01 14:57 ` [PATCH 074/125] gccrs: Add name resolution for on globbing use decl Arthur Cohen
2024-08-01 14:57 ` [PATCH 075/125] gccrs: Shape up name resolver for normal direct calls Arthur Cohen
2024-08-01 14:57 ` [PATCH 076/125] gccrs: Add call to globbing visitor Arthur Cohen
2024-08-01 14:57 ` [PATCH 077/125] gccrs: Make globbing definition shadowable by default Arthur Cohen
2024-08-01 14:57 ` [PATCH 078/125] gccrs: Add support for ambiguous use declarations Arthur Cohen
2024-08-01 14:57 ` [PATCH 079/125] gccrs: Add tuple struct constructor to value namespace Arthur Cohen
2024-08-01 14:57 ` [PATCH 080/125] gccrs: Change error message to match test Arthur Cohen
2024-08-01 14:57 ` [PATCH 081/125] gccrs: Visit function return type in default resolver Arthur Cohen
2024-08-01 14:57 ` [PATCH 082/125] gccrs: Visit constant item " Arthur Cohen
2024-08-01 14:57 ` [PATCH 083/125] gccrs: Raw pointer type visitor didn't require overload Arthur Cohen
2024-08-01 14:57 ` [PATCH 084/125] gccrs: Values shall be inserted in the value namespace Arthur Cohen
2024-08-01 14:57 ` [PATCH 085/125] gccrs: Unit struct constructor shall be resolved Arthur Cohen
2024-08-01 14:57 ` [PATCH 086/125] gccrs: Add tuple struct to the type namespace Arthur Cohen
2024-08-01 14:57 ` [PATCH 087/125] gccrs: Change enum namespace from value to type Arthur Cohen
2024-08-01 14:57 ` [PATCH 088/125] gccrs: Struct are types, not values Arthur Cohen
2024-08-01 14:57 ` [PATCH 089/125] gccrs: Add constant identifiers to the value namespace Arthur Cohen
2024-08-01 14:57 ` [PATCH 090/125] gccrs: Remove extern block scoping Arthur Cohen
2024-08-01 14:57 ` [PATCH 091/125] gccrs: Remove unsafe block empty visit function Arthur Cohen
2024-08-01 14:57 ` [PATCH 092/125] gccrs: Use new name resolver to compile constant items Arthur Cohen
2024-08-01 14:57 ` [PATCH 093/125] gccrs: Reinject Self parameter in new resolver Arthur Cohen
2024-08-01 14:57 ` [PATCH 094/125] gccrs: Update assignment operator with cratenum Arthur Cohen
2024-08-01 14:57 ` [PATCH 095/125] gccrs: Prevent getting immutable context with classic nr Arthur Cohen
2024-08-01 14:57 ` [PATCH 096/125] gccrs: Fix quoted string format Arthur Cohen
2024-08-01 14:57 ` [PATCH 097/125] gccrs: Add mappings for struct base and struct fields Arthur Cohen
2024-08-01 14:57 ` [PATCH 098/125] gccrs: Fix use rebind name resolution Arthur Cohen
2024-08-01 14:57 ` [PATCH 099/125] gccrs: compile: resolve-path-ref: properly resolve nodeId with nr2.0 Arthur Cohen
2024-08-01 14:57 ` [PATCH 100/125] gccrs: nr2.0: Add new test cases Arthur Cohen
2024-08-01 14:57 ` [PATCH 101/125] gccrs: Add globbing name resolution 2.0 test Arthur Cohen
2024-08-01 14:57 ` [PATCH 102/125] gccrs: Change dfs function return type to support gcc 4.8 Arthur Cohen
2024-08-01 14:57 ` [PATCH 103/125] gccrs: Improve parsing of raw byte string literals Arthur Cohen
2024-08-01 14:57 ` [PATCH 104/125] gccrs: Recognize rustc_deprecated as a builtin attribute Arthur Cohen
2024-08-01 14:57 ` [PATCH 105/125] gccrs: Recognize unstable " Arthur Cohen
2024-08-01 14:57 ` [PATCH 106/125] gccrs: Avoid parsing const unsafe/extern functions as async Arthur Cohen
2024-08-01 14:57 ` [PATCH 107/125] gccrs: Improve parsing of raw string literals Arthur Cohen
2024-08-01 14:57 ` [PATCH 108/125] gccrs: raw-strings: Remove dg-excess-error directive Arthur Cohen
2024-08-01 14:57 ` [PATCH 109/125] gccrs: unify: Always coerce `!` to the target type Arthur Cohen
2024-08-01 14:57 ` [PATCH 110/125] gccrs: borrowck: Use rust-system.h Arthur Cohen
2024-08-01 14:57 ` [PATCH 111/125] gccrs: borrowck: Unify BIR terminilogy (node->statement) Arthur Cohen
2024-08-01 14:57 ` [PATCH 112/125] gccrs: borrowck: BIR: use callable API Arthur Cohen
2024-08-01 14:57 ` [PATCH 113/125] gccrs: borrowck: BIR: Place tree traverse API Arthur Cohen
2024-08-01 14:57 ` [PATCH 114/125] gccrs: borrowck: BIR: scope handling Arthur Cohen
2024-08-01 14:57 ` [PATCH 115/125] gccrs: borrowck: BIR: emit moves Arthur Cohen
2024-08-01 14:57 ` [PATCH 116/125] gccrs: borrowck: BIR: make BIR visitor const Arthur Cohen
2024-08-01 14:57 ` [PATCH 117/125] gccrs: borrowck: Polonius FFI Arthur Cohen
2024-08-01 14:57 ` [PATCH 118/125] gccrs: borrowck: Free region representation Arthur Cohen
2024-08-01 14:57 ` [PATCH 119/125] gccrs: borrowck: extract regions from types using VA Arthur Cohen
2024-08-01 14:57 ` [PATCH 120/125] gccrs: borrowck: Regions in BIR Arthur Cohen
2024-08-01 14:57 ` [PATCH 121/125] gccrs: borrowck: Fact collector Arthur Cohen
2024-08-01 14:57 ` [PATCH 122/125] gccrs: borrowck: Remove block braces to satisfy GNU style Arthur Cohen
2024-08-01 14:57 ` [PATCH 123/125] gccrs: borrowck: Bump copyright notice Arthur Cohen
2024-08-01 14:58 ` [PATCH 124/125] gccrs: Visit type during resolution of inherent impl Arthur Cohen
2024-08-01 14:58 ` [PATCH 125/125] gccrs: Add a test for inherent impl type name resolve 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=20240801145809.366388-15-arthur.cohen@embecosm.com \
--to=arthur.cohen@embecosm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gcc-rust@gcc.gnu.org \
/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).