• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- DbiStreamBuilder.h - PDB Dbi 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_PDBDBISTREAMBUILDER_H
11 #define LLVM_DEBUGINFO_PDB_RAW_PDBDBISTREAMBUILDER_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/PDBFile.h"
18 #include "llvm/DebugInfo/PDB/Raw/RawConstants.h"
19 
20 namespace llvm {
21 namespace pdb {
22 class DbiStream;
23 class PDBFile;
24 
25 class DbiStreamBuilder {
26 public:
27   DbiStreamBuilder(PDBFile &File);
28 
29   DbiStreamBuilder(const DbiStreamBuilder &) = delete;
30   DbiStreamBuilder &operator=(const DbiStreamBuilder &) = delete;
31 
32   void setVersionHeader(PdbRaw_DbiVer V);
33   void setAge(uint32_t A);
34   void setBuildNumber(uint16_t B);
35   void setPdbDllVersion(uint16_t V);
36   void setPdbDllRbld(uint16_t R);
37   void setFlags(uint16_t F);
38   void setMachineType(PDB_Machine M);
39 
40   Expected<std::unique_ptr<DbiStream>> build();
41 
42 private:
43   PDBFile &File;
44   Optional<PdbRaw_DbiVer> VerHeader;
45   uint32_t Age;
46   uint16_t BuildNumber;
47   uint16_t PdbDllVersion;
48   uint16_t PdbDllRbld;
49   uint16_t Flags;
50   PDB_Machine MachineType;
51 };
52 }
53 }
54 
55 #endif
56