[lld] r247816 - COFF: Rename /opt:lldicf -> /opt:icf.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 09:33:58 PDT 2015


Author: ruiu
Date: Wed Sep 16 11:33:57 2015
New Revision: 247816

URL: http://llvm.org/viewvc/llvm-project?rev=247816&view=rev
Log:
COFF: Rename /opt:lldicf -> /opt:icf.

Now that ICF is complete, we can rename this option so that
the driver accepts the MSVC-compatible command line option.

Modified:
    lld/trunk/COFF/Config.h
    lld/trunk/COFF/Driver.cpp
    lld/trunk/COFF/Writer.cpp
    lld/trunk/test/COFF/icf-circular.test
    lld/trunk/test/COFF/icf-circular2.test
    lld/trunk/test/COFF/icf-simple.test

Modified: lld/trunk/COFF/Config.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Config.h?rev=247816&r1=247815&r2=247816&view=diff
==============================================================================
--- lld/trunk/COFF/Config.h (original)
+++ lld/trunk/COFF/Config.h Wed Sep 16 11:33:57 2015
@@ -88,8 +88,8 @@ struct Configuration {
   DefinedRelative *SEHTable = nullptr;
   DefinedAbsolute *SEHCount = nullptr;
 
-  // Used for /opt:icf
-  bool ICF = false;
+  // True if /opt:icf is specified.
+  bool DoICF = false;
 
   // Used for /opt:lldlto=N
   unsigned LTOOptLevel = 2;

Modified: lld/trunk/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=247816&r1=247815&r2=247816&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Wed Sep 16 11:33:57 2015
@@ -369,8 +369,8 @@ void LinkerDriver::link(llvm::ArrayRef<c
       Config->DoGC = false;
       continue;
     }
-    if (S == "lldicf") {
-      Config->ICF = true;
+    if (S == "icf" || StringRef(S).startswith("icf=")) {
+      Config->DoICF = true;
       continue;
     }
     if (StringRef(S).startswith("lldlto=")) {
@@ -386,11 +386,8 @@ void LinkerDriver::link(llvm::ArrayRef<c
         error("/opt:lldltojobs: invalid job count: " + Jobs);
       continue;
     }
-    if (S != "ref" && S != "icf" && S != "noicf" &&
-        S != "lbr" && S != "nolbr" &&
-        !StringRef(S).startswith("icf=")) {
+    if (S != "ref" && S != "noicf" && S != "lbr" && S != "nolbr")
       error(Twine("/opt: unknown option: ") + S);
-    }
   }
 
   // Handle /failifmismatch

Modified: lld/trunk/COFF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Writer.cpp?rev=247816&r1=247815&r2=247816&view=diff
==============================================================================
--- lld/trunk/COFF/Writer.cpp (original)
+++ lld/trunk/COFF/Writer.cpp Wed Sep 16 11:33:57 2015
@@ -288,7 +288,7 @@ void Writer::markLive() {
 
 // Merge identical COMDAT sections.
 void Writer::dedupCOMDATs() {
-  if (Config->ICF)
+  if (Config->DoICF)
     doICF(Symtab->getChunks());
 }
 

Modified: lld/trunk/test/COFF/icf-circular.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/icf-circular.test?rev=247816&r1=247815&r2=247816&view=diff
==============================================================================
--- lld/trunk/test/COFF/icf-circular.test (original)
+++ lld/trunk/test/COFF/icf-circular.test Wed Sep 16 11:33:57 2015
@@ -1,6 +1,6 @@
 # RUN: yaml2obj < %s > %t.obj
 # RUN: lld-link /entry:foo /out:%t.exe /subsystem:console /include:bar \
-# RUN:   /opt:lldicf /verbose %t.obj > %t.log 2>&1
+# RUN:   /opt:icf /verbose %t.obj > %t.log 2>&1
 # RUN: FileCheck %s < %t.log
 
 # CHECK: Selected foo

Modified: lld/trunk/test/COFF/icf-circular2.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/icf-circular2.test?rev=247816&r1=247815&r2=247816&view=diff
==============================================================================
--- lld/trunk/test/COFF/icf-circular2.test (original)
+++ lld/trunk/test/COFF/icf-circular2.test Wed Sep 16 11:33:57 2015
@@ -1,6 +1,6 @@
 # RUN: yaml2obj < %s > %t.obj
 # RUN: lld-link /entry:foo /out:%t.exe /subsystem:console /include:bar \
-# RUN:   /opt:lldicf /verbose %t.obj > %t.log 2>&1
+# RUN:   /opt:icf /verbose %t.obj > %t.log 2>&1
 # RUN: FileCheck %s < %t.log
 
 # CHECK: Selected foo

Modified: lld/trunk/test/COFF/icf-simple.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/icf-simple.test?rev=247816&r1=247815&r2=247816&view=diff
==============================================================================
--- lld/trunk/test/COFF/icf-simple.test (original)
+++ lld/trunk/test/COFF/icf-simple.test Wed Sep 16 11:33:57 2015
@@ -1,6 +1,6 @@
 # RUN: yaml2obj < %s > %t.obj
 # RUN: lld-link /entry:foo /out:%t.exe /subsystem:console /include:bar \
-# RUN:   /opt:lldicf /verbose %t.obj > %t.log 2>&1
+# RUN:   /opt:icf /verbose %t.obj > %t.log 2>&1
 # RUN: FileCheck %s < %t.log
 
 # CHECK: Selected foo




More information about the llvm-commits mailing list