[lld] r292090 - Use error() instead of fatal() to handle file open error.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 16 12:23:00 PST 2017


Currently, no, this is the last thing we do in the linker, and there's no
functionality that become unreachable if -Map fails.

But I think we shouldn't create a resulting executable/DSO if this feature
fails. I'll make that change.

On Mon, Jan 16, 2017 at 10:19 AM, David Blaikie <dblaikie at gmail.com> wrote:

> Test coverage?
>
> I assume now that it's error rather than fatal, there's some other
> reachable functionality? (eg, I guess, if you pass two files - the first of
> which fails to open, the second is processed after this patch where  it
> wasn't previously?)
>
> On Sun, Jan 15, 2017 at 5:18 PM Rui Ueyama via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: ruiu
>> Date: Sun Jan 15 19:07:19 2017
>> New Revision: 292090
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=292090&view=rev
>> Log:
>> Use error() instead of fatal() to handle file open error.
>>
>> Modified:
>>     lld/trunk/ELF/MapFile.cpp
>>
>> Modified: lld/trunk/ELF/MapFile.cpp
>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MapFile.
>> cpp?rev=292090&r1=292089&r2=292090&view=diff
>> ============================================================
>> ==================
>> --- lld/trunk/ELF/MapFile.cpp (original)
>> +++ lld/trunk/ELF/MapFile.cpp Sun Jan 15 19:07:19 2017
>> @@ -122,8 +122,9 @@ void elf::writeMapFile(ArrayRef<OutputSe
>>    std::error_code EC;
>>    raw_fd_ostream OS(Config->MapFile, EC, sys::fs::F_None);
>>    if (EC)
>> -    fatal("cannot open " + Config->MapFile + ": " + EC.message());
>> -  writeMapFile2<ELFT>(OS, OutputSections);
>> +    error("cannot open " + Config->MapFile + ": " + EC.message());
>> +  else
>> +    writeMapFile2<ELFT>(OS, OutputSections);
>>  }
>>
>>  template void elf::writeMapFile<ELF32LE>(ArrayRef<OutputSectionBase *>);
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170116/6043d6f9/attachment.html>


More information about the llvm-commits mailing list