[PATCH] D14520: llvm-lto: trivial spelling changes to distinguish custom diagnostic handler and default diagnostic handler

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 10 09:56:07 PST 2015


> On 2015-Nov-09, at 15:50, Yunzhong Gao <Yunzhong_Gao at playstation.sony.com> wrote:
> 
> ygao created this revision.
> ygao added subscribers: joker.eph, dexonsmith, pcc, rafael, llvm-commits.
> 
> Make a trivial spelling change (capitalization) to the llvm-lto tester to distinguish when a custom diagnostic handler is installed (llvm-lto -use-diagnostic-handler) and when a default handler is being used. This is split off from D14313.
> 
> http://reviews.llvm.org/D14520
> 
> Files:
>  test/LTO/X86/diagnostic-handler-remarks.ll
>  tools/llvm-lto/llvm-lto.cpp
> 
> Index: tools/llvm-lto/llvm-lto.cpp
> ===================================================================
> --- tools/llvm-lto/llvm-lto.cpp
> +++ tools/llvm-lto/llvm-lto.cpp
> @@ -103,16 +103,16 @@
>                               const char *Msg, void *) {
>   switch (Severity) {
>   case LTO_DS_NOTE:
> -    errs() << "note: ";
> +    errs() << "Note: ";

I'd rather say:
--
errs() << "llvm-lto: ";
switch (Severity) {
case LTO_DS_NOTE:
  errs() << "note: ";
--

Instead of using a style that's inconsistent, it adds the tool name.  I
think that will still get you what you want for testability?

LGTM if you change to that.

>     break;
>   case LTO_DS_REMARK:
> -    errs() << "remark: ";
> +    errs() << "Remark: ";
>     break;
>   case LTO_DS_ERROR:
> -    errs() << "error: ";
> +    errs() << "Error: ";
>     break;
>   case LTO_DS_WARNING:
> -    errs() << "warning: ";
> +    errs() << "Warning: ";
>     break;
>   }
>   errs() << Msg << "\n";
> Index: test/LTO/X86/diagnostic-handler-remarks.ll
> ===================================================================
> --- test/LTO/X86/diagnostic-handler-remarks.ll
> +++ test/LTO/X86/diagnostic-handler-remarks.ll
> @@ -9,7 +9,7 @@
> 
> ; RUN: llvm-lto -pass-remarks=inline -use-diagnostic-handler \
> ; RUN:         -exported-symbol _main -o %t.o %t.bc 2>&1 | \
> -; RUN:     FileCheck %s -allow-empty -check-prefix=REMARKS
> +; RUN:     FileCheck %s -allow-empty -check-prefix=REMARKS_DH
> ; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
> 
> ; Confirm that -pass-remarks are not printed by default.
> @@ -24,7 +24,9 @@
> ; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
> 
> ; REMARKS: remark:
> +; REMARKS_DH: Remark:
> ; CHECK-NOT: remark:
> +; CHECK-NOT: Remark:
> ; NM-NOT: foo
> ; NM: main
> 
> 
> 
> <D14520.39763.patch>



More information about the llvm-commits mailing list