[PECOFF] Enable input file logging if /debug is given.
authorRui Ueyama <ruiu@google.com>
Thu, 26 Sep 2013 22:46:04 +0000 (22:46 +0000)
committerRui Ueyama <ruiu@google.com>
Thu, 26 Sep 2013 22:46:04 +0000 (22:46 +0000)
llvm-svn: 191469

lld/lib/Driver/WinLinkDriver.cpp
lld/unittests/DriverTests/WinLinkDriverTest.cpp

index 8c769a7..80ea91a 100644 (file)
@@ -414,6 +414,9 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct
       // LLD is not yet capable of creating a PDB file, so /debug does not have
       // any effect, other than disabling dead stripping.
       ctx.setDeadStripping(false);
+
+      // Prints out input files during core linking to help debugging.
+      ctx.setLogInputFiles(true);
       break;
 
     case OPT_force:
index 55defc8..9f801de 100644 (file)
@@ -61,6 +61,7 @@ TEST_F(WinLinkParserTest, Basic) {
   EXPECT_TRUE(_context.isTerminalServerAware());
   EXPECT_TRUE(_context.getDynamicBaseEnabled());
   EXPECT_TRUE(_context.deadStrip());
+  EXPECT_FALSE(_context.logInputFiles());
 }
 
 TEST_F(WinLinkParserTest, StartsWithHyphen) {
@@ -318,6 +319,7 @@ TEST_F(WinLinkParserTest, SwapRunFromNet) {
 TEST_F(WinLinkParserTest, Debug) {
   EXPECT_TRUE(parse("link.exe", "/debug", "a.out", nullptr));
   EXPECT_FALSE(_context.deadStrip());
+  EXPECT_TRUE(_context.logInputFiles());
 }
 
 TEST_F(WinLinkParserTest, Fixed) {