[lld] r291413 - Add linker-script-included files to reproduce tar files.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 11:52:26 PST 2017


On Mon, Jan 9, 2017 at 8:32 AM, Rafael Avila de Espindola <
rafael.espindola at gmail.com> wrote:

> Rui Ueyama via llvm-commits <llvm-commits at lists.llvm.org> writes:
>
> > Author: ruiu
> > Date: Sun Jan  8 19:42:02 2017
> > New Revision: 291413
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=291413&view=rev
> > Log:
> > Add linker-script-included files to reproduce tar files.
> >
> > Previously, files added using INCLUDE directive weren't added
> > to reproduce archives. In this patch, I defined a function to
> > open a file and use that from Driver and LinkerScript.
>
> Thanks!
>
> > +  if (sys::fs::exists(Tok)) {
> > +    if (Optional<MemoryBufferRef> MB = readFile(Tok))
> > +      tokenize(*MB);
> > +    return;
> > +  }
>
> Why do you need to use sys::fs::exists? Can't you just check the return
> of readFile?
>

readFile prints out an error message if a given file cannot be opened. In
this context, there's an alternative choice, so we don't want to emit an
error message on the first failure.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170109/d8e0227f/attachment.html>


More information about the llvm-commits mailing list