[PATCH] D24492: [LTO] Switch to the new resolution-based API.

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 10:56:54 PDT 2016


rafael added inline comments.

================
Comment at: lld/ELF/InputFiles.cpp:672
@@ -705,5 +671,3 @@
 void BitcodeFile::parse(DenseSet<StringRef> &ComdatGroups) {
-  Obj = check(IRObjectFile::create(MB, Driver->Context));
-  const Module &M = Obj->getModule();
-
+  Obj = check(llvm::lto::InputFile::create(MB));
   DenseSet<const Comdat *> KeptComdats;
----------------
You don't need the llvm prefix.

================
Comment at: lld/ELF/LTO.cpp:67
@@ -99,1 +66,3 @@
+  lto::ThinBackend Backend;
+  unsigned ParallelCodeGenParallelismLevel = Config->LtoJobs;
 
----------------
Just inline the variable into the single use.

================
Comment at: lld/ELF/LTO.cpp:88
@@ -138,6 +87,3 @@
 
-static bool shouldInternalize(const SmallPtrSet<GlobalValue *, 8> &Used,
-                              Symbol *S, GlobalValue *GV) {
-  if (S->IsUsedInRegularObj || Used.count(GV))
-    return false;
-  return !S->includeInDynsym();
+  return (HasError)
+             ? nullptr
----------------
You don't need the ()

================
Comment at: lld/ELF/LTO.cpp:122
@@ +121,3 @@
+    R.Prevailing =
+        !(ObjSym.getFlags() & object::BasicSymbolRef::SF_Undefined) &&
+        B->File == &F;
----------------
Add a comment on why you need the undefined check.


https://reviews.llvm.org/D24492





More information about the llvm-commits mailing list