Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/ruff_formatter/src/printer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ impl<'a> Printer<'a> {
}

/// Prints a single element and push the following elements to queue
// LLVM considers this function too large to inline on its own, but it is called for every

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LLVM does have a point, given that the function is called twice. But it's probably fine, we may want to reconsider if the function is ever called in three places.

// element visited by the printing loop.
#[inline(always)]
fn print_element(
&mut self,
stack: &mut PrintCallStack,
Expand Down Expand Up @@ -438,6 +441,10 @@ impl<'a> Printer<'a> {
Ok(print_mode)
}

// LLVM considers this function too large to inline on its own, but it is called for every
// text element visited by the printing loop.
#[expect(clippy::inline_always)]
#[inline(always)]
fn print_text(&mut self, text: Text) {
if !self.state.pending_indent.is_empty() {
let indent = std::mem::take(&mut self.state.pending_indent);
Expand Down
Loading