[llvm] r263577 - Add missing error handling in llvm-lto
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 18 17:23:25 PDT 2016
Indeed, good point!
Done in r263860.
--
Mehdi
> On Mar 16, 2016, at 9:27 AM, Rafael EspĂndola <rafael.espindola at gmail.com> wrote:
>
> Is it possible to add a testcase?
>
> Cheers,
> Rafael
>
>
> On 15 March 2016 at 13:17, Mehdi Amini via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
>> Author: mehdi_amini
>> Date: Tue Mar 15 15:17:55 2016
>> New Revision: 263577
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=263577&view=rev
>> Log:
>> Add missing error handling in llvm-lto
>>
>> Annoyingly, ErrorOr allows to *not check* the error when things go
>> well. It will crash badly when there is an error though. It should
>> runtime assert when it is used without being checked!
>>
>> From: Mehdi Amini <mehdi.amini at apple.com>
>>
>> Modified:
>> llvm/trunk/tools/llvm-lto/llvm-lto.cpp
>>
>> Modified: llvm/trunk/tools/llvm-lto/llvm-lto.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-lto/llvm-lto.cpp?rev=263577&r1=263576&r2=263577&view=diff
>> ==============================================================================
>> --- llvm/trunk/tools/llvm-lto/llvm-lto.cpp (original)
>> +++ llvm/trunk/tools/llvm-lto/llvm-lto.cpp Tue Mar 15 15:17:55 2016
>> @@ -258,6 +258,7 @@ static void createCombinedModuleSummaryI
>> CurrentActivity = "loading file '" + Filename + "'";
>> ErrorOr<std::unique_ptr<ModuleSummaryIndex>> IndexOrErr =
>> llvm::getModuleSummaryIndexForFile(Filename, diagnosticHandler);
>> + error(IndexOrErr, "error: " + CurrentActivity);
>> std::unique_ptr<ModuleSummaryIndex> Index = std::move(IndexOrErr.get());
>> CurrentActivity = "";
>> // Skip files without a module summary.
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list