LLVM  10.0.0svn
DbiModuleDescriptor.h
Go to the documentation of this file.
1 //===- DbiModuleDescriptor.h - PDB module information -----------*- 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_RAW_DBIMODULEDESCRIPTOR_H
10 #define LLVM_DEBUGINFO_PDB_RAW_DBIMODULEDESCRIPTOR_H
11 
12 #include "llvm/ADT/StringRef.h"
16 #include "llvm/Support/Error.h"
17 #include <cstdint>
18 #include <vector>
19 
20 namespace llvm {
21 
22 namespace pdb {
23 
25  friend class DbiStreamBuilder;
26 
27 public:
31 
33 
34  bool hasECInfo() const;
35  uint16_t getTypeServerIndex() const;
36  uint16_t getModuleStreamIndex() const;
40  uint32_t getNumberOfFiles() const;
43 
44  StringRef getModuleName() const;
45  StringRef getObjFileName() const;
46 
47  uint32_t getRecordLength() const;
48 
49  const SectionContrib &getSectionContrib() const;
50 
51 private:
52  StringRef ModuleName;
53  StringRef ObjFileName;
54  const ModuleInfoHeader *Layout = nullptr;
55 };
56 
57 } // end namespace pdb
58 
59 template <> struct VarStreamArrayExtractor<pdb::DbiModuleDescriptor> {
62  if (auto EC = pdb::DbiModuleDescriptor::initialize(Stream, Info))
63  return EC;
64  Length = Info.getRecordLength();
65  return Error::success();
66  }
67 };
68 
69 } // end namespace llvm
70 
71 #endif // LLVM_DEBUGINFO_PDB_RAW_DBIMODULEDESCRIPTOR_H
This class represents lattice values for constants.
Definition: AllocatorList.h:23
VarStreamArrayExtractor is intended to be specialized to provide customized extraction logic...
const SectionContrib & getSectionContrib() const
static Error initialize(BinaryStreamRef Stream, DbiModuleDescriptor &Info)
Analysis containing CSE Info
Definition: CSEInfo.cpp:20
The header preceding each entry in the Module Info substream of the DBI stream.
Definition: RawTypes.h:212
static ErrorSuccess success()
Create a success value.
Definition: Error.h:326
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
Error operator()(BinaryStreamRef Stream, uint32_t &Length, pdb::DbiModuleDescriptor &Info)
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48