LLVM 22.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
13#include "llvm/Support/Error.h"
14
17
18namespace llvm {
20
21namespace msf {
22class MSFBuilder;
23struct MSFLayout;
24}
25namespace pdb {
26class NamedStreamMap;
27
29public:
31 NamedStreamMap &NamedStreams);
34
37
38 // If this is true, the PDB contents are hashed and this hash is used as
39 // PDB GUID and as Signature. The age is always 1.
41
42 // These only have an effect if hashPDBContentsToGUID() is false.
46
47 bool hashPDBContentsToGUID() const { return HashPDBContentsToGUID; }
48 uint32_t getAge() const { return Age; }
49 codeview::GUID getGuid() const { return Guid; }
50 std::optional<uint32_t> getSignature() const { return Signature; }
51
53
55
56 LLVM_ABI Error commit(const msf::MSFLayout &Layout,
57 WritableBinaryStreamRef Buffer) const;
58
59private:
60 msf::MSFBuilder &Msf;
61
62 std::vector<PdbRaw_FeatureSig> Features;
64 uint32_t Age;
65 std::optional<uint32_t> Signature;
66 codeview::GUID Guid;
67
68 bool HashPDBContentsToGUID = false;
69
70 NamedStreamMap &NamedStreams;
71};
72} // namespace pdb
73}
74
75#endif
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
#define LLVM_ABI
Definition Compiler.h:213
#define G(x, y, z)
Definition MD5.cpp:56
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
LLVM_ABI void setSignature(uint32_t S)
LLVM_ABI void addFeature(PdbRaw_FeatureSig Sig)
InfoStreamBuilder(const InfoStreamBuilder &)=delete
std::optional< uint32_t > getSignature() const
InfoStreamBuilder & operator=(const InfoStreamBuilder &)=delete
LLVM_ABI uint32_t finalize()
LLVM_ABI Error commit(const msf::MSFLayout &Layout, WritableBinaryStreamRef Buffer) const
LLVM_ABI InfoStreamBuilder(msf::MSFBuilder &Msf, NamedStreamMap &NamedStreams)
LLVM_ABI void setVersion(PdbRaw_ImplVer V)
LLVM_ABI void setAge(uint32_t A)
LLVM_ABI void setHashPDBContentsToGUID(bool B)
LLVM_ABI void setGuid(codeview::GUID G)
codeview::GUID getGuid() const
This is an optimization pass for GlobalISel generic memory operations.
This represents the 'GUID' type from windows.h.
Definition GUID.h:22