[PATCH] D62004: [LLD] [MinGW] Allow requesting PDB output without giving a file name

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 17 04:06:17 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rLLD361014: [MinGW] Allow requesting PDB output without giving a file name (authored by mstorsjo, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D62004?vs=199797&id=200012#toc

Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62004/new/

https://reviews.llvm.org/D62004

Files:
  MinGW/Driver.cpp
  MinGW/Options.td
  test/MinGW/driver.test


Index: MinGW/Options.td
===================================================================
--- MinGW/Options.td
+++ MinGW/Options.td
@@ -57,7 +57,9 @@
     HelpText<"Print (but do not run) the commands to run for this compilation">;
 def appcontainer: F<"appcontainer">, HelpText<"Set the appcontainer flag in the executable">;
 def mllvm: S<"mllvm">;
-def pdb: S<"pdb">, HelpText<"Specify output PDB debug information file">;
+def pdb: S<"pdb">, HelpText<"Specify output PDB debug information file. "
+                            "Defaults to the output filename, with a pdb suffix, if given an empty argument">;
+def pdb_eq: J<"pdb=">, Alias<pdb>;
 def Xlink : J<"Xlink=">, MetaVarName<"<arg>">,
     HelpText<"Pass <arg> to the COFF linker">;
 
Index: MinGW/Driver.cpp
===================================================================
--- MinGW/Driver.cpp
+++ MinGW/Driver.cpp
@@ -165,7 +165,9 @@
 
   if (auto *A = Args.getLastArg(OPT_pdb)) {
     Add("-debug");
-    Add("-pdb:" + StringRef(A->getValue()));
+    StringRef V = A->getValue();
+    if (!V.empty())
+      Add("-pdb:" + V);
   } else if (Args.hasArg(OPT_strip_debug)) {
     Add("-debug:symtab");
   } else if (!Args.hasArg(OPT_strip_all)) {
Index: test/MinGW/driver.test
===================================================================
--- test/MinGW/driver.test
+++ test/MinGW/driver.test
@@ -99,9 +99,14 @@
 STRIP-DEBUG-NOT: -debug:dwarf
 
 RUN: ld.lld -### -m i386pep foo.o -pdb out.pdb | FileCheck -check-prefix PDB %s
+RUN: ld.lld -### -m i386pep foo.o -pdb=out.pdb | FileCheck -check-prefix PDB %s
 PDB: -debug -pdb:out.pdb
 PDB-NOT: -debug:dwarf
 
+RUN: ld.lld -### -m i386pep foo.o -pdb= | FileCheck -check-prefix PDB-DEFAULT %s
+PDB-DEFAULT: -debug
+PDB-DEFAULT-NOT: -pdb:{{.*}}
+
 RUN: ld.lld -### -m i386pep foo.o --large-address-aware | FileCheck -check-prefix LARGE-ADDRESS-AWARE %s
 LARGE-ADDRESS-AWARE: -largeaddressaware
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62004.200012.patch
Type: text/x-patch
Size: 1915 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190517/041fe01e/attachment.bin>


More information about the llvm-commits mailing list