Skip to content

Commit

Permalink
avoid naming LLVM basic blocks when fewer_names is true
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdesjardins committed Mar 15, 2024
1 parent e7795ed commit 9476fe7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/builder.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::borrow::Cow;
use std::cell::Cell;
use std::convert::TryFrom;
use std::fmt::Display;
use std::ops::Deref;

use gccjit::{
Expand Down Expand Up @@ -526,14 +527,14 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
self.block
}

fn append_block(cx: &'a CodegenCx<'gcc, 'tcx>, func: RValue<'gcc>, name: &str) -> Block<'gcc> {
fn append_block(cx: &'a CodegenCx<'gcc, 'tcx>, func: RValue<'gcc>, name: impl Display) -> Block<'gcc> {
let func = cx.rvalue_as_function(func);
func.new_block(name)
func.new_block(name.to_string())
}

fn append_sibling_block(&mut self, name: &str) -> Block<'gcc> {
fn append_sibling_block(&mut self, name: impl Display) -> Block<'gcc> {
let func = self.current_func();
func.new_block(name)
func.new_block(name.to_string())
}

fn switch_to_block(&mut self, block: Self::BasicBlock) {
Expand Down

0 comments on commit 9476fe7

Please sign in to comment.