From 166c11af11af5741322f3f12790c7494d224143d Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 23 Feb 2019 11:13:24 +0100 Subject: [PATCH] Fix global value colocated printing It used to print `gv0 = colocated symbol u1:1` while cranelift-reader expects `gv0 = symbol colocated u1:1`. --- cranelift/codegen/src/ir/globalvalue.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cranelift/codegen/src/ir/globalvalue.rs b/cranelift/codegen/src/ir/globalvalue.rs index 5dc7792867..b67c26e1a2 100644 --- a/cranelift/codegen/src/ir/globalvalue.rs +++ b/cranelift/codegen/src/ir/globalvalue.rs @@ -114,10 +114,12 @@ impl fmt::Display for GlobalValueData { offset, colocated, } => { - if colocated { - write!(f, "colocated ")?; - } - write!(f, "symbol {}", name)?; + write!( + f, + "symbol {}{}", + if colocated { "colocated " } else { "" }, + name + )?; let offset_val: i64 = offset.into(); if offset_val > 0 { write!(f, "+")?;