[PATCH] D34814: [ELF] - Fail the link if something happens on DWARF parsing stage of -gdb-index building

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 11 08:59:09 PDT 2017


>> No, we have fatal(...) which is noreturn, error(...) is just a regular reporting helper,
>> that continues execution and increases ErrorCount counter.
>> So this code intention is to report all errors from parser and LLD will fail the link later.
>>
>> At the same time error reporting subsystem has error limit. I was wondering when wrote this patch
>> if I should do something like:
>>
>> if (ErrorCount  >= Config->ErrorLimit)
>>   return ErrorPolicy::Halt;
>> error(toString(Sec->File) + ": error parsing DWARF data:\n>>> " +
>>     toString(std::move(E)));
>> return ErrorPolicy::Continue;
>
>That seems more than needed. I assume the intention of Halt is to stop
>the dwarf parsing, but let the client continue.
>
>Cheers,
>Rafael

Yes, so with this we can stop parsing DWARF early if it has too many errors,
but at practice that is probably too uncommon case and not a noticable
slowdown anyways.

Because of above I did not include this lines to patch :]

George.


More information about the llvm-commits mailing list