diff options
author | Sean Silva <silvas@purdue.edu> | 2012-11-19 23:21:47 +0000 |
---|---|---|
committer | Sean Silva <silvas@purdue.edu> | 2012-11-19 23:21:47 +0000 |
commit | 525398e1376b0d61fe80a83ed2261e2e6e6ab4a3 (patch) | |
tree | 3df0b56f68780ba5f41c3ee6d1e9cc03c2c3e614 /include | |
parent | c4639d6ec2cf1e66d0bbc22db9ec530419b18784 (diff) | |
download | llvm-525398e1376b0d61fe80a83ed2261e2e6e6ab4a3.tar.gz llvm-525398e1376b0d61fe80a83ed2261e2e6e6ab4a3.tar.bz2 llvm-525398e1376b0d61fe80a83ed2261e2e6e6ab4a3.tar.xz |
Allow using MemoryBuffers with yaml::Stream directly.
The rationale is to get YAML filenames in diagnostics from
yaml::Stream::printError -- currently the filename is hard-coded as
"YAML" because there's no buffer information available.
Patch by Kim Gräsman!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168341 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Support/YAMLParser.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/Support/YAMLParser.h b/include/llvm/Support/YAMLParser.h index 12958fa173..e3f4f00388 100644 --- a/include/llvm/Support/YAMLParser.h +++ b/include/llvm/Support/YAMLParser.h @@ -77,7 +77,11 @@ std::string escape(StringRef Input); /// documents. class Stream { public: + /// @brief This keeps a reference to the string referenced by \p Input. Stream(StringRef Input, SourceMgr &); + + /// @brief This takes ownership of \p InputBuffer. + Stream(MemoryBuffer *InputBuffer, SourceMgr &); ~Stream(); document_iterator begin(); |