LLVM  4.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"
18 #include "llvm/Support/Allocator.h"
19 #include "llvm/Support/Endian.h"
20 #include "llvm/Support/Error.h"
21 
22 #include <memory>
23 #include <vector>
24 
25 namespace llvm {
26 namespace msf {
27 class MSFBuilder;
28 }
29 namespace pdb {
30 class DbiStreamBuilder;
31 class InfoStreamBuilder;
32 class TpiStreamBuilder;
33 
35 public:
36  explicit PDBFileBuilder(BumpPtrAllocator &Allocator);
37  PDBFileBuilder(const PDBFileBuilder &) = delete;
38  PDBFileBuilder &operator=(const PDBFileBuilder &) = delete;
39 
41 
47 
48  Error commit(StringRef Filename);
49 
50 private:
51  Expected<msf::MSFLayout> finalizeMsfLayout() const;
52 
53  BumpPtrAllocator &Allocator;
54 
55  std::unique_ptr<msf::MSFBuilder> Msf;
56  std::unique_ptr<InfoStreamBuilder> Info;
57  std::unique_ptr<DbiStreamBuilder> Dbi;
58  std::unique_ptr<TpiStreamBuilder> Tpi;
59  std::unique_ptr<TpiStreamBuilder> Ipi;
60 };
61 }
62 }
63 
64 #endif
PDBFileBuilder(BumpPtrAllocator &Allocator)
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
DbiStreamBuilder & getDbiBuilder()
PDBFileBuilder & operator=(const PDBFileBuilder &)=delete
Tagged union holding either a T or a Error.
TpiStreamBuilder & getIpiBuilder()
Error commit(StringRef Filename)
Error initialize(uint32_t BlockSize)
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:138
static const int BlockSize
Definition: TarWriter.cpp:34
InfoStreamBuilder & getInfoBuilder()
msf::MSFBuilder & getMsfBuilder()
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:47
TpiStreamBuilder & getTpiBuilder()