[lld] r344685 - [NewPM] teach -passes= to emit meaningful error messages

Fedor Sergeev via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 17 03:36:23 PDT 2018


Author: fedor.sergeev
Date: Wed Oct 17 03:36:23 2018
New Revision: 344685

URL: http://llvm.org/viewvc/llvm-project?rev=344685&view=rev
Log:
[NewPM] teach -passes= to emit meaningful error messages

All the PassBuilder::parse interfaces now return descriptive StringError
instead of a plain bool. It allows to make -passes/aa-pipeline parsing
errors context-specific and thus less confusing.

TODO: ideally we should also make suggestions for misspelled pass names,
but that requires some extensions to PassBuilder.

Reviewed By: philip.pfaffe, chandlerc
Differential Revision: https://reviews.llvm.org/D53246

Modified:
    lld/trunk/test/ELF/lto/ltopasses-custom.ll

Modified: lld/trunk/test/ELF/lto/ltopasses-custom.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/ltopasses-custom.ll?rev=344685&r1=344684&r2=344685&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/ltopasses-custom.ll (original)
+++ lld/trunk/test/ELF/lto/ltopasses-custom.ll Wed Oct 17 03:36:23 2018
@@ -27,11 +27,11 @@ define void @barrier() {
 ; RUN: not ld.lld -m elf_x86_64 %t.o -o %t2.so \
 ; RUN:   --lto-newpm-passes=iamnotapass -shared 2>&1 | \
 ; RUN:   FileCheck %s --check-prefix=INVALID
-; INVALID: unable to parse pass pipeline description: iamnotapass
+; INVALID: unable to parse pass pipeline description 'iamnotapass': unknown pass name 'iamnotapass'
 
 ; Check that invalid AA pipelines are rejected gracefully.
 ; RUN: not ld.lld -m elf_x86_64 %t.o -o %t2.so \
 ; RUN:   --lto-newpm-passes=globaldce --lto-aa-pipeline=patatino \
 ; RUN:   -shared 2>&1 | \
 ; RUN:   FileCheck %s --check-prefix=INVALIDAA
-; INVALIDAA: unable to parse AA pipeline description: patatino
+; INVALIDAA: unknown alias analysis name 'patatino'




More information about the llvm-commits mailing list