[lld] r331700 - Improve error message for --plugin-opt=thinlto-prefix-replace.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon May 7 16:24:25 PDT 2018


Author: ruiu
Date: Mon May  7 16:24:25 2018
New Revision: 331700

URL: http://llvm.org/viewvc/llvm-project?rev=331700&view=rev
Log:
Improve error message for --plugin-opt=thinlto-prefix-replace.

Modified:
    lld/trunk/ELF/Driver.cpp
    lld/trunk/test/ELF/lto/thinlto_prefix_replace.ll

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=331700&r1=331699&r2=331700&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Mon May  7 16:24:25 2018
@@ -807,7 +807,8 @@ void LinkerDriver::readConfigs(opt::Inpu
       std::tie(Config->ThinLTOPrefixReplace.first,
                Config->ThinLTOPrefixReplace.second) = S.substr(23).split(';');
       if (Config->ThinLTOPrefixReplace.second.empty())
-        error("thinlto-prefix-replace expects 'old;new' format");
+        error("thinlto-prefix-replace expects 'old;new' format, but got " +
+              S.substr(23));
     } else if (!S.startswith("/") && !S.startswith("-fresolution=") &&
                !S.startswith("-pass-through=") && !S.startswith("thinlto")) {
       parseClangOption(S, Arg->getSpelling());

Modified: lld/trunk/test/ELF/lto/thinlto_prefix_replace.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/thinlto_prefix_replace.ll?rev=331700&r1=331699&r2=331700&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/thinlto_prefix_replace.ll (original)
+++ lld/trunk/test/ELF/lto/thinlto_prefix_replace.ll Mon May  7 16:24:25 2018
@@ -11,8 +11,8 @@
 
 ; Ensure that lld generates error if prefix replace option does not have 'old;new' format
 ; RUN: rm -f %t/newpath/thinlto_prefix_replace.o.thinlto.bc
-; RUN: not ld.lld --plugin-opt=thinlto-index-only --plugin-opt=thinlto-prefix-replace="%t/oldpath/:%t/newpath/" -shared %t/oldpath/thinlto_prefix_replace.o -o %t/thinlto_prefix_replace 2>&1 | FileCheck %s --check-prefix=ERR
-; ERR: thinlto-prefix-replace expects 'old;new' format
+; RUN: not ld.lld --plugin-opt=thinlto-index-only --plugin-opt=thinlto-prefix-replace=abc:def -shared %t/oldpath/thinlto_prefix_replace.o -o %t/thinlto_prefix_replace 2>&1 | FileCheck %s --check-prefix=ERR
+; ERR: thinlto-prefix-replace expects 'old;new' format, but got abc:def
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"




More information about the llvm-commits mailing list