[llvm] r286177 - [LTO] Add error message on IO error in compileOptimizedToFile.

Friedman, Eli via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 8 11:53:55 PST 2016


On 11/8/2016 7:13 AM, Teresa Johnson wrote:
>
>
> On Tue, Nov 8, 2016 at 3:30 AM, Rafael EspĂ­ndola via llvm-commits 
> <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
>
>     emitError takes a twine and I don't think it is safe to have a twine
>     variable. Could this be just:
>
>     emitError(Twine("could not write object file: ") + Filename);
>
>
> Right, this isn't safe. Per Twine.h:
>   /// A Twine is not intended for use directly and should not be 
> stored, its
>   /// implementation relies on the ability to store pointers to 
> temporary stack
>   /// objects which may be deallocated at the end of a statement. 
> Twines should
>   /// only be used accepted as const references in arguments, when an 
> API wishes
>   /// to accept possibly-concatenated strings.
>
> Please change to Rafael's suggestion.
>

r286275.

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161108/62b05f2b/attachment.html>


More information about the llvm-commits mailing list