xref: /netbsd-src/external/apache2/llvm/dist/llvm/tools/obj2yaml/minidump2yaml.cpp (revision 154bfe8e089c1a0a4e9ed8414f08d3da90949162)
1 //===- minidump2yaml.cpp - Minidump to yaml conversion tool -----*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "Error.h"
10 #include "obj2yaml.h"
11 #include "llvm/Object/Minidump.h"
12 #include "llvm/ObjectYAML/MinidumpYAML.h"
13 #include "llvm/Support/YAMLTraits.h"
14 
15 using namespace llvm;
16 
17 Error minidump2yaml(raw_ostream &Out, const object::MinidumpFile &Obj) {
18   auto ExpectedObject = MinidumpYAML::Object::create(Obj);
19   if (!ExpectedObject)
20     return ExpectedObject.takeError();
21   yaml::Output Output(Out);
22   Output << *ExpectedObject;
23   return llvm::Error::success();
24 }
25