From: River Riddle Date: Sat, 25 May 2019 02:22:00 +0000 (-0700) Subject: Update the type printer for Diagnostic to automatically wrap the type with ''. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9cb3ea8fe4e808b3932ee77db77983de4fe2259b;p=platform%2Fupstream%2Fllvm.git Update the type printer for Diagnostic to automatically wrap the type with ''. -- PiperOrigin-RevId: 249935489 --- diff --git a/mlir/lib/IR/Diagnostics.cpp b/mlir/lib/IR/Diagnostics.cpp index 6d7a24a..67e1405 100644 --- a/mlir/lib/IR/Diagnostics.cpp +++ b/mlir/lib/IR/Diagnostics.cpp @@ -79,7 +79,7 @@ void DiagnosticArgument::print(raw_ostream &os) const { os << getAsString(); break; case DiagnosticArgumentKind::Type: - os << getAsType(); + os << '\'' << getAsType() << '\''; break; case DiagnosticArgumentKind::Unsigned: os << getAsUnsigned(); diff --git a/mlir/test/IR/invalid-ops.mlir b/mlir/test/IR/invalid-ops.mlir index 80c3787..2a477300 100644 --- a/mlir/test/IR/invalid-ops.mlir +++ b/mlir/test/IR/invalid-ops.mlir @@ -34,7 +34,7 @@ func @constant() { func @constant_out_of_range() { ^bb: - %x = "std.constant"(){value: 100} : () -> i1 // expected-error {{requires attribute's type (i64) to match op's return type (i1)}} + %x = "std.constant"(){value: 100} : () -> i1 // expected-error {{requires attribute's type ('i64') to match op's return type ('i1')}} return } @@ -42,7 +42,7 @@ func @constant_out_of_range() { func @constant_wrong_type() { ^bb: - %x = "std.constant"(){value: 10.} : () -> f32 // expected-error {{requires attribute's type (f64) to match op's return type (f32)}} + %x = "std.constant"(){value: 10.} : () -> f32 // expected-error {{requires attribute's type ('f64') to match op's return type ('f32')}} return } diff --git a/mlir/test/IR/invalid.mlir b/mlir/test/IR/invalid.mlir index fef4119..6eb7f59 100644 --- a/mlir/test/IR/invalid.mlir +++ b/mlir/test/IR/invalid.mlir @@ -451,7 +451,7 @@ func @dominance_failure() { func @return_type_mismatch() -> i32 { %0 = "foo"() : ()->f32 - return %0 : f32 // expected-error {{type of return operand 0 (f32) doesn't match function result type (i32)}} + return %0 : f32 // expected-error {{type of return operand 0 ('f32') doesn't match function result type ('i32')}} } // -----