[PATCH] D37119: lld-link: Use opt:noref by default in debug builds

Alex Telishev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 13:28:37 PDT 2017


alex.telishev created this revision.

MSVC linker uses /opt:icf as default  in release builds (no /DEBUG) and /opt:noref in debug builds. We should do the same


Repository:
  rL LLVM

https://reviews.llvm.org/D37119

Files:
  lld/COFF/Driver.cpp


Index: lld/COFF/Driver.cpp
===================================================================
--- lld/COFF/Driver.cpp
+++ lld/COFF/Driver.cpp
@@ -843,6 +843,12 @@
     Config->Implib = Arg->getValue();
 
   // Handle /opt
+  // msvc linker uses /opt:noref by default in debug builds
+  if (Config->Debug) {
+    Config->DoGC = false;
+    Config->DoICF = false;
+  }
+
   for (auto *Arg : Args.filtered(OPT_opt)) {
     std::string Str = StringRef(Arg->getValue()).lower();
     SmallVector<StringRef, 1> Vec;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37119.112603.patch
Type: text/x-patch
Size: 511 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170824/8358ace3/attachment.bin>


More information about the llvm-commits mailing list