[llvm] r244019 - [llvm-objdump] Call exit(1) on error, i.e. fail early.

Davide Italiano davide at freebsd.org
Wed Aug 5 17:22:12 PDT 2015


On Wed, Aug 5, 2015 at 2:48 AM, David Wiberg <dwiberg at gmail.com> wrote:
> Hi Davide,
>
> Do you have any tests planned for this change?
>

I didn't, but I agree it's a good idea. I'll ponder how to generate
broken inputs and come back with something hopefully.

> Apart from that, see minor comment inlined below.
>
> Best regards
> David
>
> 2015-08-05 9:18 GMT+02:00 Davide Italiano <davide at freebsd.org>:
>>
>>  static void report_error(StringRef File, std::error_code EC) {
>>    assert(EC);
>>    errs() << ToolName << ": '" << File << "': " << EC.message() << ".\n";
>> -  ReturnValue = EXIT_FAILURE;
>> +  exit(1);
>
> How about using exit(EXIT_FAILURE) here?
>

All the other tools use exit(1) -- so I tried to be consistent.
If we want to make a pass to change it everywhere, I'm fine with it.


More information about the llvm-commits mailing list