diff options
author | Martin Storsjo <martin@martin.st> | 2019-05-17 11:07:33 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2019-05-17 11:07:33 +0000 |
commit | 2c52ddf31f5421c5373923535b958b84c79772e3 (patch) | |
tree | 3ae2cb99cd2aa0eb098019b49014062580240176 /lld/MinGW | |
parent | ef9b8e03fd03e33818a65c23d1d3938bf7a9589f (diff) | |
download | bcm5719-llvm-2c52ddf31f5421c5373923535b958b84c79772e3.tar.gz bcm5719-llvm-2c52ddf31f5421c5373923535b958b84c79772e3.zip |
[MinGW] Allow requesting PDB output without giving a file name
When integrating PDB output in mingw targeting build systems, it
might be a lot of extra work to specify unique file names for
the pdb output. Therefore allow omitting the actual file name
and let it implicitly be the same name as the linker output, with
a pdb extension.
As the current form of the pdb option takes a separate parameter value,
e.g. "-pdb out.pdb", it is impractical to leave out the parameter value.
Therefore, introduce a second syntax for the option, with an equals
sign, like -pdb=out.pdb, where the value easily can be omitted.
The form -pdb= for requesting pdb files with an implicit name should
work fine, even though it looks a bit unconventional in that form.
Differential Revision: https://reviews.llvm.org/D62004
llvm-svn: 361014
Diffstat (limited to 'lld/MinGW')
-rw-r--r-- | lld/MinGW/Driver.cpp | 4 | ||||
-rw-r--r-- | lld/MinGW/Options.td | 4 |
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">; |