about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorErik Desjardins <erikdesjardins@users.noreply.github.com>2024-03-15 15:53:49 -0400
committerErik Desjardins <erikdesjardins@users.noreply.github.com>2024-03-15 15:53:49 -0400
commit9476fe7c3bd56bc6847538c4e3a53fee1d64e543 (patch)
tree47b37b93166ee167bfad83c62cd94a06c0fa40f3 /src
parente7795ed0fef657aa7c991772ee1c1eca6f11750c (diff)
downloadrust-9476fe7c3bd56bc6847538c4e3a53fee1d64e543.tar.gz
rust-9476fe7c3bd56bc6847538c4e3a53fee1d64e543.zip
avoid naming LLVM basic blocks when fewer_names is true
Diffstat (limited to 'src')
-rw-r--r--src/builder.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/builder.rs b/src/builder.rs
index f5cda81f6ab..c12fa1a58ff 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -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 @@ 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) {