forked from OSchip/llvm-project
COFF: Enable ICF by default.
MSVC linker enables ICF as long as /opt:ref is eanbled, so do we. llvm-svn: 247817
This commit is contained in:
parent
c04d5dbf20
commit
b02a320f5e
|
@ -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;
|
||||
|
||||
|
|
|
@ -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=")) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue