Skip to content

Commit 9476fe7

Browse files
avoid naming LLVM basic blocks when fewer_names is true
1 parent e7795ed commit 9476fe7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/builder.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::borrow::Cow;
22
use std::cell::Cell;
33
use std::convert::TryFrom;
4+
use std::fmt::Display;
45
use std::ops::Deref;
56

67
use gccjit::{
@@ -526,14 +527,14 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
526527
self.block
527528
}
528529

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

534-
fn append_sibling_block(&mut self, name: &str) -> Block<'gcc> {
535+
fn append_sibling_block(&mut self, name: impl Display) -> Block<'gcc> {
535536
let func = self.current_func();
536-
func.new_block(name)
537+
func.new_block(name.to_string())
537538
}
538539

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

0 commit comments

Comments
 (0)