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

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 12:05:32 PDT 2016


pcc added inline comments.

================
Comment at: ELF/SymbolTable.cpp:213
@@ +212,3 @@
+    Expected<std::unique_ptr<lto::InputFile>> ObjOrErr =
+        lto::InputFile::create(F->getBuffer());
+    if (!ObjOrErr)
----------------
You should replace all uses of IRObjectFile elsewhere with lto::InputFile. Then you won't need to create a new InputFile here, you can just reuse the one in the BitcodeFile.

================
Comment at: ELF/SymbolTable.cpp:225
@@ +224,3 @@
+    std::vector<lto::SymbolResolution> Resols(Syms.size());
+    for (LLVM_ATTRIBUTE_UNUSED auto &ObjSym : Obj.symbols()) {
+      Symbol *Sym = Syms[SymNum];
----------------
You shouldn't need to do this, see r281437.

================
Comment at: ELF/SymbolTable.cpp:234
@@ +233,3 @@
+        continue;
+      R.Prevailing = Sym->body()->isDefined();
+      R.VisibleToRegularObj = Sym->IsUsedInRegularObj || Sym->includeInDynsym();
----------------
This isn't right, this should test whether the SymbolBody is a DefinedBitcode and is defined by this BitcodeFile.

================
Comment at: ELF/SymbolTable.cpp:252
@@ +251,3 @@
+    auto &OutputName = Filenames[Task];
+    getOutputFileName(Filename, OutputName, MaxTasks > 1 ? Task : -1);
+    return llvm::make_unique<LTOOutput>(OutputName);
----------------
There's no need to save objects to files, you can just use raw_string_ostream and operate on the object file directly in memory.


https://reviews.llvm.org/D24492





More information about the llvm-commits mailing list