[PATCH] YAML Input improvement

Jonathan Anderson jonathan.anderson at mun.ca
Fri Jul 24 09:21:17 PDT 2015


Hello llvm-commits,

The current yaml::Input constructor only takes a StringRef for its first 
parameter: clients pass in raw string data. This means that, for the 
typical use case of opening a file and parsing it, we throw away the 
filename information and report errors as occurring in "YAML".

This patch adds an alterate yaml::Input constructor that takes a 
reference to a MemoryBuffer, then extracts the buffer and whatever 
identifier is associated with that buffer and passes them to the 
underlying yaml::Stream as a MemoryBufferRef.

There’s also a Phabricator review open at 
http://reviews.llvm.org/D11137, but I’ve also attached the patch for 
those who prefer that workflow.

Thanks very much to Alex Lorenz and Duncan Smith for their helpful 
comments on the patch and the process for getting it reviewed.


Jonathan Anderson
--
Assistant Professor
Electrical and Computer Engineering
Memorial University of Newfoundland

http://www.engr.mun.ca/~anderson
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: yaml-input.diff
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150724/d44b8c3f/attachment.ksh>


More information about the llvm-commits mailing list