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

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 11 15:01:13 PDT 2019


ruiu added inline comments.


================
Comment at: COFF/DebugTypes.cpp:46
+
+static std::vector<std::unique_ptr<TpiSource>> GC;
+
----------------
What is this? You are not using this. (If you need it in another patch, move this to the another patch.)



================
Comment at: COFF/DebugTypes.cpp:65
+}
+template <>
+TpiSource *coff::makeTpiSource(TpiSource::TpiKind K, ObjFile &File,
----------------
nit: Please add a blank line between function definitions.


================
Comment at: COFF/InputFiles.cpp:688
+  if (IsPCH) {
+    DebugTypesObj = makeTpiSource(TpiSource::PCH, *this);
+    return;
----------------
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.


================
Comment at: COFF/InputFiles.cpp:693
+  if (FirstType->kind() == LF_TYPESERVER2) {
+    auto TS = cantFail(
+        TypeDeserializer::deserializeAs<TypeServer2Record>(FirstType->data()));
----------------
Avoid `auto`.


================
Comment at: COFF/PDB.cpp:396
+  
+  auto &Types = *File->DebugTypes;
+
----------------
Please do not use `auto` unless its type is obvious from the right-hand side (e.g. cast or new).


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