diff options
author | Martin Storsjo <martin@martin.st> | 2018-05-15 06:34:18 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2018-05-15 06:34:18 +0000 |
commit | 2ece4e90eebc8a7b3c4ffb21004c44536911d2d4 (patch) | |
tree | ddfbe63612f6add834838699b233b9dcb030e45c /MinGW | |
parent | f83cccb505b84c265d0656952c615b9cc88ec66c (diff) |
[MinGW] Add a LLD specific option -pdb
This allows producing pdb debug info. This is an LLD specific option
since GCC and GNU binutils doesn't support the PDB file format.
Differential Revision: https://reviews.llvm.org/D46796
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@332327 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'MinGW')
-rw-r--r-- | MinGW/Driver.cpp | 9 | ||||
-rw-r--r-- | MinGW/Options.td | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/MinGW/Driver.cpp b/MinGW/Driver.cpp index 0b7e0831a..01cd3b26f 100644 --- a/MinGW/Driver.cpp +++ b/MinGW/Driver.cpp @@ -144,14 +144,19 @@ bool mingw::link(ArrayRef<const char *> ArgsArr, raw_ostream &Diag) { else Add("-out:a.exe"); + if (auto *A = Args.getLastArg(OPT_pdb)) { + Add("-debug"); + Add("-pdb:" + StringRef(A->getValue())); + } else if (!Args.hasArg(OPT_strip_all)) { + Add("-debug:dwarf"); + } + if (Args.hasArg(OPT_shared)) Add("-dll"); if (Args.hasArg(OPT_verbose)) Add("-verbose"); if (Args.hasArg(OPT_export_all_symbols)) Add("-export-all-symbols"); - if (!Args.hasArg(OPT_strip_all)) - Add("-debug:dwarf"); if (Args.hasArg(OPT_large_address_aware)) Add("-largeaddressaware"); if (Args.hasArg(OPT_kill_at)) diff --git a/MinGW/Options.td b/MinGW/Options.td index 684047119..d963f8277 100644 --- a/MinGW/Options.td +++ b/MinGW/Options.td @@ -41,6 +41,7 @@ def verbose: F<"verbose">, HelpText<"Verbose mode">; def _HASH_HASH_HASH : Flag<["-"], "###">, HelpText<"Print (but do not run) the commands to run for this compilation">; def mllvm: S<"mllvm">; +def pdb: S<"pdb">, HelpText<"Specify output PDB debug information file">; def Xlink : J<"Xlink=">, MetaVarName<"<arg>">, HelpText<"Pass <arg> to the COFF linker">; |