[PATCH] D26371: [LTO] Add error message on IO error in compileOptimizedToFile.

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 15:15:10 PST 2016


mehdi_amini added inline comments.


================
Comment at: lib/LTO/LTOCodeGenerator.cpp:261
+    std::string ErrMsg = "could not write object file: ";
+    ErrMsg += Filename;
+    emitError(ErrMsg);
----------------
davide wrote:
> efriedma wrote:
> > mehdi_amini wrote:
> > > Can you get the ` + Filename` on the same line as the initialization for ErrMsg? 
> > > (Otherwise never mind).
> > > 
> > I guess I could write `std::string ErrMsg = Twine("could not write object file: ") + Filename;`.  Is that better?
> I would rather leave it as is.
I'd write: `std::string ErrMsg = "could not write object file: " + Filename.str();` (if it compiles)


Repository:
  rL LLVM

https://reviews.llvm.org/D26371





More information about the llvm-commits mailing list