Subversion Repositories QNX 8.QNX8 LLVM/Clang compiler suite

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14 pmbaty 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
 
14
#include "llvm/DebugInfo/CodeView/GUID.h"
15
#include "llvm/DebugInfo/PDB/Native/RawConstants.h"
16
 
17
namespace llvm {
18
class WritableBinaryStreamRef;
19
 
20
namespace msf {
21
class MSFBuilder;
22
struct MSFLayout;
23
}
24
namespace pdb {
25
class NamedStreamMap;
26
 
27
class InfoStreamBuilder {
28
public:
29
  InfoStreamBuilder(msf::MSFBuilder &Msf, NamedStreamMap &NamedStreams);
30
  InfoStreamBuilder(const InfoStreamBuilder &) = delete;
31
  InfoStreamBuilder &operator=(const InfoStreamBuilder &) = delete;
32
 
33
  void setVersion(PdbRaw_ImplVer V);
34
  void addFeature(PdbRaw_FeatureSig Sig);
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);
43
  void setGuid(codeview::GUID G);
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
 
50
  uint32_t finalize();
51
 
52
  Error finalizeMsfLayout();
53
 
54
  Error commit(const msf::MSFLayout &Layout,
55
               WritableBinaryStreamRef Buffer) const;
56
 
57
private:
58
  msf::MSFBuilder &Msf;
59
 
60
  std::vector<PdbRaw_FeatureSig> Features;
61
  PdbRaw_ImplVer Ver;
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