summaryrefslogtreecommitdiffstats
path: root/lld/MinGW
diff options
context:
space:
mode:
Diffstat (limited to 'lld/MinGW')
-rw-r--r--lld/MinGW/Driver.cpp4
-rw-r--r--lld/MinGW/Options.td4
2 files changed, 6 insertions, 2 deletions
diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp
index d0ece57d09b..9ef85141771 100644
--- a/lld/MinGW/Driver.cpp
+++ b/lld/MinGW/Driver.cpp
@@ -165,7 +165,9 @@ bool mingw::link(ArrayRef<const char *> ArgsArr, raw_ostream &Diag) {
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)) {
diff --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td
index 403ab4219ce..2cfce15abae 100644
--- a/lld/MinGW/Options.td
+++ b/lld/MinGW/Options.td
@@ -57,7 +57,9 @@ def _HASH_HASH_HASH : Flag<["-"], "###">,
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">;
OpenPOWER on IntegriCloud