LLVM 19.0.0git
InfoStreamBuilder.h
Go to the documentation of this file.
1//===- InfoStreamBuilder.h - PDB Info Stream Creation -----------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_DEBUGINFO_PDB_NATIVE_INFOSTREAMBUILDER_H
10#define LLVM_DEBUGINFO_PDB_NATIVE_INFOSTREAMBUILDER_H
11
12#include "llvm/Support/Error.h"
13
16
17namespace llvm {
18class WritableBinaryStreamRef;
19
20namespace msf {
21class MSFBuilder;
22struct MSFLayout;
23}
24namespace pdb {
25class NamedStreamMap;
26
28public:
32
35
36 // If this is true, the PDB contents are hashed and this hash is used as
37 // PDB GUID and as Signature. The age is always 1.
38 void setHashPDBContentsToGUID(bool B);
39
40 // These only have an effect if hashPDBContentsToGUID() is false.
41 void setSignature(uint32_t S);
42 void setAge(uint32_t A);
44
45 bool hashPDBContentsToGUID() const { return HashPDBContentsToGUID; }
46 uint32_t getAge() const { return Age; }
47 codeview::GUID getGuid() const { return Guid; }
48 std::optional<uint32_t> getSignature() const { return Signature; }
49
51
53
54 Error commit(const msf::MSFLayout &Layout,
55 WritableBinaryStreamRef Buffer) const;
56
57private:
58 msf::MSFBuilder &Msf;
59
60 std::vector<PdbRaw_FeatureSig> Features;
62 uint32_t Age;
63 std::optional<uint32_t> Signature;
64 codeview::GUID Guid;
65
66 bool HashPDBContentsToGUID = false;
67
68 NamedStreamMap &NamedStreams;
69};
70} // namespace pdb
71}
72
73#endif
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define G(x, y, z)
Definition: MD5.cpp:56
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
void addFeature(PdbRaw_FeatureSig Sig)
InfoStreamBuilder(const InfoStreamBuilder &)=delete
std::optional< uint32_t > getSignature() const
InfoStreamBuilder & operator=(const InfoStreamBuilder &)=delete
Error commit(const msf::MSFLayout &Layout, WritableBinaryStreamRef Buffer) const
void setVersion(PdbRaw_ImplVer V)
void setGuid(codeview::GUID G)
codeview::GUID getGuid() const
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
This represents the 'GUID' type from windows.h.
Definition: GUID.h:21