[llvm-commits] [lld] r160732 - /lld/trunk/lib/ReaderWriter/ELF/ReaderELF.cpp

Nick Kledzik kledzik at apple.com
Thu Jul 26 22:39:53 PDT 2012


On Jul 26, 2012, at 7:50 PM, Sid Manning wrote:

> On 07/25/12 20:10, Nick Kledzik wrote:
>> Sid,
>> 
>> Please compile with -Wshadow.   ReaderELF.cpp produces a bunch of shadow
> variable warnings, usually two local variables in scope with the same name.
> Ok that produced a lot of warnings but I think I got rid of all the ones that surfaced from ReaderELF.cpp
> 
>> 
>> Also, we want Readers to cleanly return with an error_code if an errors
> occur.   This is so that the Readers can be used as a library in some other
> program (such as an IDE). The ReaderELF currently calls
> llvm::report_fatal_error() which usually terminates the program.
>> 
> No problem, I follow what ReaderCOFF does and return letting EC be dealt with by the caller.
It is sad that this loses the message string about what is wrong with the file.   The error_code style seems to be that you need to make up unique error codes for each printed error string.  At some point we will have a better solution for this and revisit this code.

> 
> The patch is attached.
Looks good. Please commit.

-Nick



More information about the llvm-commits mailing list