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

Peter Collingbourne peter at pcc.me.uk
Fri May 29 15:02:22 PDT 2015


(waiting for http://reviews.llvm.org/D10114)


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

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

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

http://reviews.llvm.org/D10115

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






More information about the llvm-commits mailing list