[lld] r213984 - [PECOFF] Add /profile command line option.

Rui Ueyama ruiu at google.com
Fri Jul 25 15:28:50 PDT 2014


Author: ruiu
Date: Fri Jul 25 17:28:49 2014
New Revision: 213984

URL: http://llvm.org/viewvc/llvm-project?rev=213984&view=rev
Log:
[PECOFF] Add /profile command line option.

Modified:
    lld/trunk/lib/Driver/WinLinkDriver.cpp
    lld/trunk/lib/Driver/WinLinkOptions.td
    lld/trunk/unittests/DriverTests/WinLinkDriverTest.cpp

Modified: lld/trunk/lib/Driver/WinLinkDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkDriver.cpp?rev=213984&r1=213983&r2=213984&view=diff
==============================================================================
--- lld/trunk/lib/Driver/WinLinkDriver.cpp (original)
+++ lld/trunk/lib/Driver/WinLinkDriver.cpp Fri Jul 25 17:28:49 2014
@@ -1162,6 +1162,13 @@ bool WinLinkDriver::parse(int argc, cons
       ctx.setSwapRunFromNet(true);
       break;
 
+    case OPT_profile:
+      // /profile implies /opt:ref, /opt:noicf, /incremental:no and /fixed:no.
+      ctx.setDeadStripping(true);
+      ctx.setBaseRelocationEnabled(false);
+      ctx.setDynamicBaseEnabled(false);
+      break;
+
     case OPT_implib:
       ctx.setOutputImportLibraryPath(inputArg->getValue());
       break;

Modified: lld/trunk/lib/Driver/WinLinkOptions.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkOptions.td?rev=213984&r1=213983&r2=213984&view=diff
==============================================================================
--- lld/trunk/lib/Driver/WinLinkOptions.td (original)
+++ lld/trunk/lib/Driver/WinLinkOptions.td Fri Jul 25 17:28:49 2014
@@ -63,6 +63,7 @@ def verbose : F<"verbose">;
 def debug : F<"debug">;
 def swaprun_cd : F<"swaprun:cd">;
 def swaprun_net : F<"swaprun:net">;
+def profile : F<"profile">;
 
 def force : F<"force">,
     HelpText<"Allow undefined symbols when creating executables">;

Modified: lld/trunk/unittests/DriverTests/WinLinkDriverTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/unittests/DriverTests/WinLinkDriverTest.cpp?rev=213984&r1=213983&r2=213984&view=diff
==============================================================================
--- lld/trunk/unittests/DriverTests/WinLinkDriverTest.cpp (original)
+++ lld/trunk/unittests/DriverTests/WinLinkDriverTest.cpp Fri Jul 25 17:28:49 2014
@@ -652,6 +652,17 @@ TEST_F(WinLinkParserTest, OptUnknown) {
 }
 
 //
+// Test for /PROFILE
+//
+
+TEST_F(WinLinkParserTest, Profile) {
+  EXPECT_TRUE(parse("link.exe", "/profile", "a.obj", nullptr));
+  EXPECT_TRUE(_context.deadStrip());
+  EXPECT_FALSE(_context.getBaseRelocationEnabled());
+  EXPECT_FALSE(_context.getDynamicBaseEnabled());
+}
+
+//
 // Test for command line flags that are ignored.
 //
 





More information about the llvm-commits mailing list