• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- InfoStreamBuilder.h - PDB Info Stream Creation -----------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_DEBUGINFO_PDB_RAW_PDBINFOSTREAMBUILDER_H
11 #define LLVM_DEBUGINFO_PDB_RAW_PDBINFOSTREAMBUILDER_H
12 
13 #include "llvm/ADT/Optional.h"
14 #include "llvm/Support/Error.h"
15 
16 #include "llvm/DebugInfo/PDB/PDBTypes.h"
17 #include "llvm/DebugInfo/PDB/Raw/NameMap.h"
18 #include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
19 #include "llvm/DebugInfo/PDB/Raw/RawConstants.h"
20 
21 namespace llvm {
22 namespace pdb {
23 class NameMap;
24 class PDBFile;
25 
26 class InfoStreamBuilder {
27 public:
28   InfoStreamBuilder(IPDBFile &File);
29   InfoStreamBuilder(const InfoStreamBuilder &) = delete;
30   InfoStreamBuilder &operator=(const InfoStreamBuilder &) = delete;
31 
32   void setVersion(PdbRaw_ImplVer V);
33   void setSignature(uint32_t S);
34   void setAge(uint32_t A);
35   void setGuid(PDB_UniqueId G);
36 
37   Expected<std::unique_ptr<InfoStream>> build();
38 
39 private:
40   IPDBFile &File;
41   Optional<PdbRaw_ImplVer> Ver;
42   Optional<uint32_t> Sig;
43   Optional<uint32_t> Age;
44   Optional<PDB_UniqueId> Guid;
45   Optional<NameMap> NamedStreams;
46 };
47 }
48 }
49 
50 #endif
51