1 //===- InfoStreamBuilder.h - PDB Info Stream Creation -----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_PDB_RAW_PDBINFOSTREAMBUILDER_H
11 #define LLVM_DEBUGINFO_PDB_RAW_PDBINFOSTREAMBUILDER_H
13 #include "llvm/ADT/Optional.h"
14 #include "llvm/Support/Error.h"
16 #include "llvm/DebugInfo/PDB/Native/NamedStreamMap.h"
17 #include "llvm/DebugInfo/PDB/Native/PDBFile.h"
18 #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
19 #include "llvm/DebugInfo/PDB/PDBTypes.h"
22 class WritableBinaryStreamRef;
31 class InfoStreamBuilder {
33 InfoStreamBuilder(msf::MSFBuilder &Msf, NamedStreamMap &NamedStreams);
34 InfoStreamBuilder(const InfoStreamBuilder &) = delete;
35 InfoStreamBuilder &operator=(const InfoStreamBuilder &) = delete;
37 void setVersion(PdbRaw_ImplVer V);
38 void setSignature(uint32_t S);
39 void setAge(uint32_t A);
40 void setGuid(codeview::GUID G);
41 void addFeature(PdbRaw_FeatureSig Sig);
43 uint32_t getAge() const { return Age; }
44 codeview::GUID getGuid() const { return Guid; }
45 Optional<uint32_t> getSignature() const { return Signature; }
49 Error finalizeMsfLayout();
51 Error commit(const msf::MSFLayout &Layout,
52 WritableBinaryStreamRef Buffer) const;
57 std::vector<PdbRaw_FeatureSig> Features;
60 Optional<uint32_t> Signature;
63 NamedStreamMap &NamedStreams;