[lld] r313180 - Use getUnaliasedOption so that this switch works for option aliases.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 12:44:36 PDT 2017


Author: ruiu
Date: Wed Sep 13 12:44:36 2017
New Revision: 313180

URL: http://llvm.org/viewvc/llvm-project?rev=313180&view=rev
Log:
Use getUnaliasedOption so that this switch works for option aliases.

There are no alises handled by this switch, but getUnaliasesdOption is
preferred way of doing this. This is also consistent with ELF and COFF.

Modified:
    lld/trunk/MinGW/Driver.cpp

Modified: lld/trunk/MinGW/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/MinGW/Driver.cpp?rev=313180&r1=313179&r2=313180&view=diff
==============================================================================
--- lld/trunk/MinGW/Driver.cpp (original)
+++ lld/trunk/MinGW/Driver.cpp Wed Sep 13 12:44:36 2017
@@ -178,7 +178,7 @@ bool mingw::link(ArrayRef<const char *>
   StringRef Prefix = "";
   bool Static = false;
   for (auto *A : Args) {
-    switch (A->getOption().getID()) {
+    switch (A->getOption().getUnaliasedOption().getID()) {
     case OPT_INPUT:
       if (StringRef(A->getValue()).endswith(".def"))
         Add("-def:" + StringRef(A->getValue()));




More information about the llvm-commits mailing list