avoid naming LLVM basic blocks when fewer_names is true

This commit is contained in:
Erik Desjardins 2024-03-15 15:53:49 -04:00
parent e7795ed0fe
commit 9476fe7c3b

View File

@ -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::{
@ -526,14 +527,14 @@ fn llbb(&self) -> Block<'gcc> {
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) {