[PATCH] D59053: [LLD][COFF] Early dependency detection

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 13:50:26 PDT 2019


ruiu added inline comments.


================
Comment at: COFF/InputFiles.cpp:688
+  if (IsPCH) {
+    DebugTypesObj = makeTpiSource(TpiSource::PCH, *this);
+    return;
----------------
aganea wrote:
> aganea wrote:
> > ruiu wrote:
> > > If you do know the first argument for all function calls of `makeTpiSource`, you can define one function for each value of the first argument, instead of calling the same function and then dispatch according to the first argument.
> > I did like you said - however now there are details leaking out of `DebugTypes.h`, like `TypeServer2Record` parameter to `makeUseTypeServerSource()`, which now requires having `#include "llvm/DebugInfo/CodeView/TypeRecord.h"` directly in `DebugTypes.h`, which can slow down compilation - if `DebugTypes.h` is included elsewhere. It's a tradeoff between terseness and compilation speed, please let me know which you prefer.
> Forget what I said, it was late last night. Changed the parameters to pointers and forward declarations.
I was about to say that you probably could make use of forward declaration, but you already did. :)


================
Comment at: COFF/InputFiles.cpp:662
 
+void ObjFile::initializeDependencies() {
+  if (!Config->Debug)
----------------
Could you write a function comment as to what this function is supposed to do so that it can be easily understood for a first-time reader?


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59053/new/

https://reviews.llvm.org/D59053





More information about the llvm-commits mailing list