[PATCH] D50404: [lld-link] Generalize handling of /debug and /debug:{none, full, fastlink, ghash, symtab}

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 20 10:09:44 PDT 2018


ruiu added a comment.

Looks much better!



================
Comment at: COFF/Driver.cpp:939
+
+  bool ShouldCreatePDB = false;
+  if (Debug == DebugKind::Full || Debug == DebugKind::Dwarf ||
----------------
It is better to initialize directly to a desired value here:

  bool ShouldCreatePDB = (Debug == DebugKind::Full || Debug == DebugKind::GHash);


================
Comment at: COFF/Driver.cpp:944
     Config->Incremental = true;
-    if (auto *Arg = Args.getLastArg(OPT_debugtype))
-      Config->DebugTypes = parseDebugType(Arg->getValue());
-    else
-      Config->DebugTypes = getDefaultDebugType(Args);
+    Config->DebugTypes = parseDebugTypes(Args);
+    ShouldCreatePDB = Debug != DebugKind::Dwarf;
----------------
Do you really have to call this function only when a debug flag is given? It looks to me that it is safe to do this unconditionally.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D50404





More information about the llvm-commits mailing list