[PATCH] D26371: [LTO] Add error message on IO error in compileOptimizedToFile.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 7 15:18:15 PST 2016
davide added inline comments.
================
Comment at: lib/LTO/LTOCodeGenerator.cpp:261
+ std::string ErrMsg = "could not write object file: ";
+ ErrMsg += Filename;
+ emitError(ErrMsg);
----------------
mehdi_amini wrote:
> 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)
Agree, if it compiles. But using the `Twine` is a little bit cumbersome here, at least to me.
Repository:
rL LLVM
https://reviews.llvm.org/D26371
More information about the llvm-commits
mailing list