xref: /freebsd/contrib/llvm-project/llvm/tools/llvm-pdbutil/YAMLOutputStyle.h (revision 02e9120893770924227138ba49df1edb3896112a)
1 //===- YAMLOutputStyle.h -------------------------------------- *- 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 #ifndef LLVM_TOOLS_LLVMPDBDUMP_YAMLOUTPUTSTYLE_H
10 #define LLVM_TOOLS_LLVMPDBDUMP_YAMLOUTPUTSTYLE_H
11 
12 #include "OutputStyle.h"
13 #include "PdbYaml.h"
14 
15 #include "llvm/Support/ScopedPrinter.h"
16 #include "llvm/Support/YAMLTraits.h"
17 
18 namespace llvm {
19 namespace pdb {
20 
21 class YAMLOutputStyle : public OutputStyle {
22 public:
23   YAMLOutputStyle(PDBFile &File);
24 
25   Error dump() override;
26 
27 private:
28   Error dumpStringTable();
29   Error dumpFileHeaders();
30   Error dumpStreamMetadata();
31   Error dumpStreamDirectory();
32   Error dumpPDBStream();
33   Error dumpDbiStream();
34   Error dumpTpiStream();
35   Error dumpIpiStream();
36   Error dumpPublics();
37 
38   void flush();
39 
40   PDBFile &File;
41   llvm::yaml::Output Out;
42 
43   yaml::PdbObject Obj;
44 };
45 } // namespace pdb
46 } // namespace llvm
47 
48 #endif // LLVM_TOOLS_LLVMPDBDUMP_YAMLOUTPUTSTYLE_H
49