[lld] r191232 - [PECOFF] Ignore /delay and /delayload options.

Rui Ueyama ruiu at google.com
Mon Sep 23 15:41:46 PDT 2013

Author: ruiu
Date: Mon Sep 23 17:41:46 2013
New Revision: 191232

URL: http://llvm.org/viewvc/llvm-project?rev=191232&view=rev
[PECOFF] Ignore /delay and /delayload options.

These options are to enable DLL delay loading. If enabled, DLL is loaded
at run time by a helper routine when a function in the DLL is actually called
for the first time, instead of making the Windows loader to load all DLLs at
startup time. This should shorten startup delay if an executable have many
imported symbols.

The linker needs to create a "delayed import table" and link delayimp.lib in
which helper functions are defined to support the feature.

For now, we just ignore the options, so that the linker does not complain when
it sees these options. We want to support them in the future.


Modified: lld/trunk/lib/Driver/WinLinkOptions.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkOptions.td?rev=191232&r1=191231&r2=191232&view=diff
--- lld/trunk/lib/Driver/WinLinkOptions.td (original)
+++ lld/trunk/lib/Driver/WinLinkOptions.td Mon Sep 23 17:41:46 2013
@@ -61,12 +61,20 @@ def help_q : F<"?">, Alias<help>;
 def DASH_DASH : Option<["--"], "", KIND_REMAINING_ARGS>;
 // The flags below do nothing. They are defined only for link.exe compatibility.
 multiclass Q<string name> {
   def "" : Joined<["/", "-", "-?"], name#":">;
   def _c : Separate<["/", "-", "-?"], name>, Alias<!cast<Option>(name)>;
 def nologo : F<"nologo">;
 defm errorreport : Q<"errorreport">;
 def incremental : F<"incremental">;
 def no_incremental : F<"incremental:no">;
+defm delay : Q<"delay">;
+defm delayload : Q<"delayload">;

Modified: lld/trunk/unittests/DriverTests/WinLinkDriverTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/unittests/DriverTests/WinLinkDriverTest.cpp?rev=191232&r1=191231&r2=191232&view=diff
--- lld/trunk/unittests/DriverTests/WinLinkDriverTest.cpp (original)
+++ lld/trunk/unittests/DriverTests/WinLinkDriverTest.cpp Mon Sep 23 17:41:46 2013
@@ -337,7 +337,8 @@ TEST_F(WinLinkParserTest, Ignore) {
   // There are some no-op command line options that are recognized for
   // compatibility with link.exe.
   EXPECT_FALSE(parse("link.exe", "/nologo", "/errorreport:prompt",
-                     "/incremental", "/incremental:no", "a.obj", nullptr));
+                     "/incremental", "/incremental:no", "/delay:unload",
+                     "/delayload:user32", "a.obj", nullptr));
   EXPECT_EQ("", errorMessage());
   EXPECT_EQ(1, inputFileCount());
   EXPECT_EQ("a.obj", inputFile(0));

More information about the llvm-commits mailing list