This is an archive of the discontinued LLVM Phabricator instance.

Add filename support to yaml::Input.
ClosedPublic

Authored by trombonehero on Jul 13 2017, 6:45 PM.

Details

Summary

The current yaml::Input constructor takes a StringRef of data as its
first parameter, discarding any filename information that may have been
present when a YAML file was opened. Add an alterate yaml::Input
constructor that takes a MemoryBufferRef, which can have a filename
associated with it. This leads to clearer diagnostic messages.

Sponsored By: DARPA, AFRL

Event Timeline

trombonehero created this revision.Jul 13 2017, 6:45 PM

(previously known as D11137)

asb added a subscriber: asb.Jul 14 2017, 4:58 AM

This isn't part of LLVM I usually hack on, but I just wanted to comment to say:

  1. I've manually verified this patch applies cleanly to top of tree and all checks pass
  2. The patch looks good to me, and addresses the final nits from @arphaman in the previous revision. The only other changes vs the previous revision seems to be the removal of CurrentNode from the initialiser list as the field now has a default initialiser (as of rL305969).

@arphaman: are you happy with this patch now?

arphaman accepted this revision.Jul 14 2017, 7:48 AM

Yep, LGTM. Thanks.

This revision is now accepted and ready to land.Jul 14 2017, 7:48 AM
This revision was automatically updated to reflect the committed changes.