summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_codegen_cranelift/src/pretty_clif.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
commit9918693037dce8aa4bb6f08741b6812923486c18 (patch)
tree21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /compiler/rustc_codegen_cranelift/src/pretty_clif.rs
parentReleasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff)
downloadrustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz
rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/pretty_clif.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/src/pretty_clif.rs21
1 files changed, 12 insertions, 9 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/pretty_clif.rs b/compiler/rustc_codegen_cranelift/src/pretty_clif.rs
index da84e54a9..196418023 100644
--- a/compiler/rustc_codegen_cranelift/src/pretty_clif.rs
+++ b/compiler/rustc_codegen_cranelift/src/pretty_clif.rs
@@ -58,11 +58,10 @@
use std::fmt;
use std::io::Write;
-use cranelift_codegen::{
- entity::SecondaryMap,
- ir::entities::AnyEntity,
- write::{FuncWriter, PlainWriter},
-};
+use cranelift_codegen::entity::SecondaryMap;
+use cranelift_codegen::ir::entities::AnyEntity;
+use cranelift_codegen::ir::Fact;
+use cranelift_codegen::write::{FuncWriter, PlainWriter};
use rustc_middle::ty::layout::FnAbiOf;
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_session::config::{OutputFilenames, OutputType};
@@ -155,8 +154,13 @@ impl FuncWriter for &'_ CommentWriter {
_func: &Function,
entity: AnyEntity,
value: &dyn fmt::Display,
+ maybe_fact: Option<&Fact>,
) -> fmt::Result {
- write!(w, " {} = {}", entity, value)?;
+ if let Some(fact) = maybe_fact {
+ write!(w, " {} ! {} = {}", entity, fact, value)?;
+ } else {
+ write!(w, " {} = {}", entity, value)?;
+ }
if let Some(comment) = self.entity_comments.get(&entity) {
writeln!(w, " ; {}", comment.replace('\n', "\n; "))
@@ -227,9 +231,8 @@ pub(crate) fn write_ir_file(
let res = std::fs::File::create(clif_file_name).and_then(|mut file| write(&mut file));
if let Err(err) = res {
// Using early_warn as no Session is available here
- let handler = rustc_session::EarlyErrorHandler::new(
- rustc_session::config::ErrorOutputType::default(),
- );
+ let handler =
+ rustc_session::EarlyDiagCtxt::new(rustc_session::config::ErrorOutputType::default());
handler.early_warn(format!("error writing ir file: {}", err));
}
}