LLVM  5.0.0
PDBFileBuilder.h
Go to the documentation of this file.
1 //===- PDBFileBuilder.h - PDB File 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_PDBFILEBUILDER_H
11 #define LLVM_DEBUGINFO_PDB_RAW_PDBFILEBUILDER_H
12 
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/ADT/BitVector.h"
15 #include "llvm/ADT/Optional.h"
20 #include "llvm/Support/Allocator.h"
21 #include "llvm/Support/Endian.h"
22 #include "llvm/Support/Error.h"
23 
24 #include <memory>
25 #include <vector>
26 
27 namespace llvm {
28 namespace msf {
29 class MSFBuilder;
30 }
31 namespace pdb {
32 class DbiStreamBuilder;
33 class InfoStreamBuilder;
34 class PublicsStreamBuilder;
35 class TpiStreamBuilder;
36 
38 public:
39  explicit PDBFileBuilder(BumpPtrAllocator &Allocator);
41  PDBFileBuilder(const PDBFileBuilder &) = delete;
42  PDBFileBuilder &operator=(const PDBFileBuilder &) = delete;
43 
45 
53 
54  Error commit(StringRef Filename);
55 
58 
59 private:
60  Expected<msf::MSFLayout> finalizeMsfLayout();
61 
62  BumpPtrAllocator &Allocator;
63 
64  std::unique_ptr<msf::MSFBuilder> Msf;
65  std::unique_ptr<InfoStreamBuilder> Info;
66  std::unique_ptr<DbiStreamBuilder> Dbi;
67  std::unique_ptr<PublicsStreamBuilder> Publics;
68  std::unique_ptr<TpiStreamBuilder> Tpi;
69  std::unique_ptr<TpiStreamBuilder> Ipi;
70 
71  PDBStringTableBuilder Strings;
72  NamedStreamMap NamedStreams;
73 };
74 }
75 }
76 
77 #endif
PDBFileBuilder(BumpPtrAllocator &Allocator)
PDBStringTableBuilder & getStringTableBuilder()
Expected< uint32_t > getNamedStreamIndex(StringRef Name) const
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
DbiStreamBuilder & getDbiBuilder()
PDBFileBuilder & operator=(const PDBFileBuilder &)=delete
Tagged union holding either a T or a Error.
Definition: CachePruning.h:23
TpiStreamBuilder & getIpiBuilder()
Error commit(StringRef Filename)
const char * Name
Error initialize(uint32_t BlockSize)
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:138
PublicsStreamBuilder & getPublicsBuilder()
static const int BlockSize
Definition: TarWriter.cpp:34
InfoStreamBuilder & getInfoBuilder()
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
msf::MSFBuilder & getMsfBuilder()
Error addNamedStream(StringRef Name, uint32_t Size)
Lightweight error class with error context and mandatory checking.
Definition: Error.h:156
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
TpiStreamBuilder & getTpiBuilder()