[lld] [LLD] [COFF] Rewrite handling of the /debug: option. NFC. (PR #75175)
Zequan Wu via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 14 15:16:23 PST 2023
Martin =?utf-8?q?Storsjö?= <martin at martin.st>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/75175 at github.com>
================
@@ -1647,13 +1607,47 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
if (args.hasArg(OPT_force, OPT_force_multipleres))
config->forceMultipleRes = true;
+ // Don't warn about long section names, such as .debug_info, for mingw (or
+ // when -debug:dwarf is requested, handled below).
+ if (config->mingw)
+ config->warnLongSectionNames = false;
+
+ bool doGC = true;
+
// Handle /debug
- DebugKind debug = parseDebugKind(args);
- if (debug == DebugKind::Full || debug == DebugKind::Dwarf ||
- debug == DebugKind::GHash || debug == DebugKind::NoGHash) {
- config->debug = true;
- config->incremental = true;
- config->includeDwarfChunks = true;
+ bool shouldCreatePDB = false;
+ if (auto *arg = args.getLastArg(OPT_debug, OPT_debug_opt)) {
+ std::string s;
+ if (arg->getOption().getID() == OPT_debug)
+ s = "full";
+ else
+ s = StringRef(arg->getValue()).lower();
+ if (s == "fastlink") {
+ warn("/debug:fastlink unsupported; using /debug:full");
+ s = "full";
+ }
+ if (s == "none") {
----------------
ZequanWu wrote:
Oh, I missed that. That makes sense.
https://github.com/llvm/llvm-project/pull/75175
More information about the llvm-commits
mailing list