summaryrefslogtreecommitdiff
path: root/lib/Support/YAMLTraits.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/YAMLTraits.cpp')
-rw-r--r--lib/Support/YAMLTraits.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Support/YAMLTraits.cpp b/lib/Support/YAMLTraits.cpp
index 601084f9eae3c..65eda246a7fea 100644
--- a/lib/Support/YAMLTraits.cpp
+++ b/lib/Support/YAMLTraits.cpp
@@ -60,6 +60,14 @@ Input::Input(StringRef InputContent, void *Ctxt,
DocIterator = Strm->begin();
}
+Input::Input(MemoryBufferRef Input, void *Ctxt,
+ SourceMgr::DiagHandlerTy DiagHandler, void *DiagHandlerCtxt)
+ : IO(Ctxt), Strm(new Stream(Input, SrcMgr, false, &EC)) {
+ if (DiagHandler)
+ SrcMgr.setDiagHandler(DiagHandler, DiagHandlerCtxt);
+ DocIterator = Strm->begin();
+}
+
Input::~Input() = default;
std::error_code Input::error() { return EC; }