[LLVMdev] [lld] Handling a whole bunch of readers

Michael Spencer bigcheesegs at gmail.com
Mon Oct 14 17:41:51 PDT 2013


On Wed, Oct 9, 2013 at 11:23 AM, Shankar Easwaran
<shankare at codeaurora.org>wrote:

> Hi,
>
> We have a whole bunch of readers(we would have some more too), and was
> thinking if we should have a vector of Readers, and have a function
> isMyFormat in each of them.
>
> Any reader that knows to handle, goes ahead and parses the file.
>
> On a side note, we currently use .objtxt as an figure out if the file is a
> YAML file or not. I have added FIXME's in the code, if we could some kind
> of magic (or) a better way to figure out if the file is YAML ?
>
> Thanks
>
> Shankar Easwaran
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted
> by the Linux Foundation
>
>
So apparently I didn't reply all when I suggested this.

For determining which YAML reader to use, we should use YAML tags. This
allows multiple different types of input files in a single YAML stream.

!archive
<blah>
---
!ELF
<blah>
---
!atoms
<blah>

For differentiating between linker scripts and YAML, I agree that some form
of comment magic is best.

- Michael Spencer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131014/a9434db3/attachment.html>


More information about the llvm-dev mailing list