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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 10:29:48 PDT 2016


ruiu added inline comments.

================
Comment at: lld/ELF/Error.h:36
@@ -33,1 +35,3 @@
 
+inline void check(Error E, std::string Msg = "") {
+  handleAllErrors(std::move(E), [&](llvm::ErrorInfoBase &EIB) {
----------------
You are not using Msg.

================
Comment at: lld/ELF/LTO.cpp:150
@@ +149,3 @@
+  unsigned MaxTasks = LtoObj->getMaxTasks();
+  std::vector<SmallString<128>> Filenames(MaxTasks);
+  Buff.resize(MaxTasks);
----------------
Filenames is not a large vector, so please use std::string for simplicity.

================
Comment at: lld/ELF/LTO.cpp:155-156
@@ +154,4 @@
+      [&](size_t Task) -> std::unique_ptr<lto::NativeObjectStream> {
+    auto &OutputName = Filenames[Task];
+    getOutputFileName(Filename, OutputName, MaxTasks > 1 ? Task : -1);
+    return llvm::make_unique<lto::NativeObjectStream>(
----------------
I'd make `getOutputFilename` a pure function that returns std::string so that we can do

  Filenames[Task] = getOutputFilename(Filename, MaxTasks > 1 ? Task : -1);


https://reviews.llvm.org/D24492





More information about the llvm-commits mailing list