LLVM  8.0.0svn
DbiModuleDescriptor.h
Go to the documentation of this file.
1 //===- DbiModuleDescriptor.h - PDB module information -----------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_DEBUGINFO_PDB_RAW_DBIMODULEDESCRIPTOR_H
11 #define LLVM_DEBUGINFO_PDB_RAW_DBIMODULEDESCRIPTOR_H
12 
13 #include "llvm/ADT/StringRef.h"
17 #include "llvm/Support/Error.h"
18 #include <cstdint>
19 #include <vector>
20 
21 namespace llvm {
22 
23 namespace pdb {
24 
26  friend class DbiStreamBuilder;
27 
28 public:
32 
34 
35  bool hasECInfo() const;
36  uint16_t getTypeServerIndex() const;
37  uint16_t getModuleStreamIndex() const;
41  uint32_t getNumberOfFiles() const;
44 
45  StringRef getModuleName() const;
46  StringRef getObjFileName() const;
47 
48  uint32_t getRecordLength() const;
49 
50  const SectionContrib &getSectionContrib() const;
51 
52 private:
53  StringRef ModuleName;
54  StringRef ObjFileName;
55  const ModuleInfoHeader *Layout = nullptr;
56 };
57 
58 } // end namespace pdb
59 
60 template <> struct VarStreamArrayExtractor<pdb::DbiModuleDescriptor> {
63  if (auto EC = pdb::DbiModuleDescriptor::initialize(Stream, Info))
64  return EC;
65  Length = Info.getRecordLength();
66  return Error::success();
67  }
68 };
69 
70 } // end namespace llvm
71 
72 #endif // LLVM_DEBUGINFO_PDB_RAW_DBIMODULEDESCRIPTOR_H
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
VarStreamArrayExtractor is intended to be specialized to provide customized extraction logic...
const SectionContrib & getSectionContrib() const
static Error initialize(BinaryStreamRef Stream, DbiModuleDescriptor &Info)
The header preceeding each entry in the Module Info substream of the DBI stream.
Definition: RawTypes.h:213
static ErrorSuccess success()
Create a success value.
Definition: Error.h:327
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:158
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49