[PATCH] Initial implementation of link-time optimization for the new COFF linker.

Rui Ueyama ruiu at google.com
Fri May 29 13:51:52 PDT 2015


LGTM


================
Comment at: COFF/Driver.cpp:101
@@ -92,1 +100,3 @@
 bool link(int Argc, const char *Argv[]) {
+  llvm::InitializeAllTargetInfos();
+  llvm::InitializeAllTargets();
----------------
Add a comment saying that initialize for LTO.

================
Comment at: COFF/SymbolTable.cpp:232
@@ +231,3 @@
+  if (auto EC = Obj->parse())
+    return EC;
+  ObjectFiles.emplace_back(Obj);
----------------
Looks like Obj leaks here.

================
Comment at: COFF/SymbolTable.cpp:240
@@ +239,3 @@
+    StringRef Name = Body->getName();
+    Symbol *&Sym = Symtab[Name];
+    if (!Sym)
----------------
This can be Symbol * instead of Symbol *&.

================
Comment at: COFF/SymbolTable.cpp:243
@@ +242,3 @@
+      return make_dynamic_error_code(Twine("LTO: unexpected new symbol: ") +
+                                     Name);
+    Body->setBackref(Sym);
----------------
Can't this fit in 80 columns? (If not, never mind).

http://reviews.llvm.org/D10115

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list