diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-11-11 13:26:19 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-11-21 12:10:37 +0100 |
| commit | cd7218aa9f4cdbfec0bc90ca86a9caa9cd271938 (patch) | |
| tree | 59b5312aa116c62f8333a6afd333205419c1019c /src | |
| parent | 97ca520c448fbfb405ba3560ce521b2e31c81cc2 (diff) | |
| download | rust-cd7218aa9f4cdbfec0bc90ca86a9caa9cd271938.tar.gz rust-cd7218aa9f4cdbfec0bc90ca86a9caa9cd271938.zip | |
Update Cranelift to 0.102
Diffstat (limited to 'src')
| -rw-r--r-- | src/pretty_clif.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/pretty_clif.rs b/src/pretty_clif.rs index da84e54a916..02c0dcb8b1b 100644 --- a/src/pretty_clif.rs +++ b/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; ")) |
