From 951e605c7ba11fc89e225bf3203d7f47651fbef8 Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Thu, 24 May 2018 23:00:22 +0000 Subject: [PATCH] [Debugify] Avoid printing unnecessary square braces, NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333236 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/DebugInfo/debugify.ll | 4 ++-- test/Transforms/Mem2Reg/PromoteMemToRegister.ll | 2 +- tools/opt/Debugify.cpp | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/test/DebugInfo/debugify.ll b/test/DebugInfo/debugify.ll index fd265378a4e..91e2371e16a 100644 --- a/test/DebugInfo/debugify.ll +++ b/test/DebugInfo/debugify.ll @@ -84,6 +84,6 @@ define weak_odr zeroext i1 @baz() { ; CHECK-FAIL: WARNING: Missing line 3 ; CHECK-FAIL: WARNING: Missing line 4 ; CHECK-FAIL: ERROR: Missing variable 1 -; CHECK-FAIL: CheckModuleDebugify [{{.*}}]: FAIL +; CHECK-FAIL: CheckModuleDebugify: FAIL -; PASS: CheckModuleDebugify [{{.*}}]: PASS +; PASS: CheckModuleDebugify: PASS diff --git a/test/Transforms/Mem2Reg/PromoteMemToRegister.ll b/test/Transforms/Mem2Reg/PromoteMemToRegister.ll index 08221907596..202b206d749 100644 --- a/test/Transforms/Mem2Reg/PromoteMemToRegister.ll +++ b/test/Transforms/Mem2Reg/PromoteMemToRegister.ll @@ -2,7 +2,7 @@ ; RUN: opt < %s -debugify -mem2reg -check-debugify -S 2>&1 | FileCheck %s ; CHECK-NOT: alloca -; CHECK: CheckModuleDebugify [{{.*}}]: PASS +; CHECK: CheckModuleDebugify: PASS define double @testfunc(i32 %i, double %j) { %I = alloca i32 ; [#uses=4] diff --git a/tools/opt/Debugify.cpp b/tools/opt/Debugify.cpp index 39bbaa81316..fb810da231f 100644 --- a/tools/opt/Debugify.cpp +++ b/tools/opt/Debugify.cpp @@ -191,8 +191,10 @@ bool checkDebugifyMetadata(Module &M, errs() << "ERROR: Missing variable " << Idx + 1 << "\n"; HasErrors |= MissingVars.count() > 0; - errs() << Banner << " [" << NameOfWrappedPass << "]: " - << (HasErrors ? "FAIL" : "PASS") << '\n'; + errs() << Banner; + if (!NameOfWrappedPass.empty()) + errs() << " [" << NameOfWrappedPass << "]"; + errs() << ": " << (HasErrors ? "FAIL" : "PASS") << '\n'; if (HasErrors) { errs() << "Module IR Dump\n"; M.print(errs(), nullptr, false); -- 2.11.0