summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/COFF/Config.h4
-rw-r--r--lld/COFF/Driver.cpp1
-rw-r--r--lld/test/COFF/icf-circular.test2
-rw-r--r--lld/test/COFF/icf-circular2.test2
-rw-r--r--lld/test/COFF/icf-simple.test2
5 files changed, 5 insertions, 6 deletions
diff --git a/lld/COFF/Config.h b/lld/COFF/Config.h
index 5b0964be39b..4558d576849 100644
--- a/lld/COFF/Config.h
+++ b/lld/COFF/Config.h
@@ -66,6 +66,7 @@ struct Configuration {
bool NoEntry = false;
std::string OutputFile;
bool DoGC = true;
+ bool DoICF = true;
bool Relocatable = true;
bool Force = false;
bool Debug = false;
@@ -88,9 +89,6 @@ struct Configuration {
DefinedRelative *SEHTable = nullptr;
DefinedAbsolute *SEHCount = nullptr;
- // True if /opt:icf is specified.
- bool DoICF = false;
-
// Used for /opt:lldlto=N
unsigned LTOOptLevel = 2;
diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp
index 457dc05329a..1d60cbb7f3b 100644
--- a/lld/COFF/Driver.cpp
+++ b/lld/COFF/Driver.cpp
@@ -367,6 +367,7 @@ void LinkerDriver::link(llvm::ArrayRef<const char *> ArgsArr) {
std::string S = StringRef(Arg->getValue()).lower();
if (S == "noref") {
Config->DoGC = false;
+ Config->DoICF = false;
continue;
}
if (S == "icf" || StringRef(S).startswith("icf=")) {
diff --git a/lld/test/COFF/icf-circular.test b/lld/test/COFF/icf-circular.test
index 29d6fcf16ea..7348cd9d22f 100644
--- a/lld/test/COFF/icf-circular.test
+++ b/lld/test/COFF/icf-circular.test
@@ -1,6 +1,6 @@
# RUN: yaml2obj < %s > %t.obj
# RUN: lld-link /entry:foo /out:%t.exe /subsystem:console /include:bar \
-# RUN: /opt:icf /verbose %t.obj > %t.log 2>&1
+# RUN: /verbose %t.obj > %t.log 2>&1
# RUN: FileCheck %s < %t.log
# CHECK: Selected foo
diff --git a/lld/test/COFF/icf-circular2.test b/lld/test/COFF/icf-circular2.test
index 8af6f9d8a3f..e7598c12436 100644
--- a/lld/test/COFF/icf-circular2.test
+++ b/lld/test/COFF/icf-circular2.test
@@ -1,6 +1,6 @@
# RUN: yaml2obj < %s > %t.obj
# RUN: lld-link /entry:foo /out:%t.exe /subsystem:console /include:bar \
-# RUN: /opt:icf /verbose %t.obj > %t.log 2>&1
+# RUN: /verbose %t.obj > %t.log 2>&1
# RUN: FileCheck %s < %t.log
# CHECK: Selected foo
diff --git a/lld/test/COFF/icf-simple.test b/lld/test/COFF/icf-simple.test
index 8b43b983ab2..f913b6afec2 100644
--- a/lld/test/COFF/icf-simple.test
+++ b/lld/test/COFF/icf-simple.test
@@ -1,6 +1,6 @@
# RUN: yaml2obj < %s > %t.obj
# RUN: lld-link /entry:foo /out:%t.exe /subsystem:console /include:bar \
-# RUN: /opt:icf /verbose %t.obj > %t.log 2>&1
+# RUN: /verbose %t.obj > %t.log 2>&1
# RUN: FileCheck %s < %t.log
# CHECK: Selected foo
OpenPOWER on IntegriCloud