LLVM  14.0.0git
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_NATIVE_DBIMODULEDESCRIPTOR_H
10 #define LLVM_DEBUGINFO_PDB_NATIVE_DBIMODULEDESCRIPTOR_H
11 
12 #include "llvm/ADT/StringRef.h"
16 #include "llvm/Support/Error.h"
17 #include <cstdint>
18 
19 namespace llvm {
20 
21 namespace pdb {
22 
24  friend class DbiStreamBuilder;
25 
26 public:
27  DbiModuleDescriptor() = default;
30 
32 
33  bool hasECInfo() const;
39  uint32_t getNumberOfFiles() const;
42 
43  StringRef getModuleName() const;
44  StringRef getObjFileName() const;
45 
46  uint32_t getRecordLength() const;
47 
48  const SectionContrib &getSectionContrib() const;
49 
50 private:
51  StringRef ModuleName;
52  StringRef ObjFileName;
53  const ModuleInfoHeader *Layout = nullptr;
54 };
55 
56 } // end namespace pdb
57 
58 template <> struct VarStreamArrayExtractor<pdb::DbiModuleDescriptor> {
61  if (auto EC = pdb::DbiModuleDescriptor::initialize(Stream, Info))
62  return EC;
63  Length = Info.getRecordLength();
64  return Error::success();
65  }
66 };
67 
68 } // end namespace llvm
69 
70 #endif // LLVM_DEBUGINFO_PDB_NATIVE_DBIMODULEDESCRIPTOR_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::pdb::SectionContrib
Definition: RawTypes.h:46
RawTypes.h
StringRef.h
llvm::pdb::DbiModuleDescriptor::getSourceFileNameIndex
uint32_t getSourceFileNameIndex() const
Definition: DbiModuleDescriptor.cpp:68
llvm::Error::success
static ErrorSuccess success()
Create a success value.
Definition: Error.h:331
Error.h
llvm::pdb::DbiModuleDescriptor::hasECInfo
bool hasECInfo() const
Definition: DbiModuleDescriptor.cpp:35
llvm::VarStreamArrayExtractor
VarStreamArrayExtractor is intended to be specialized to provide customized extraction logic.
Definition: BinaryStreamArray.h:47
llvm::pdb::DbiModuleDescriptor::DbiModuleDescriptor
DbiModuleDescriptor()=default
llvm::pdb::DbiStreamBuilder
Definition: DbiStreamBuilder.h:43
llvm::pdb::ModuleInfoHeader
The header preceding each entry in the Module Info substream of the DBI stream.
Definition: RawTypes.h:212
llvm::pdb::DbiModuleDescriptor::getTypeServerIndex
uint16_t getTypeServerIndex() const
Definition: DbiModuleDescriptor.cpp:39
llvm::pdb::DbiModuleDescriptor::getRecordLength
uint32_t getRecordLength() const
Definition: DbiModuleDescriptor.cpp:80
Info
Analysis containing CSE Info
Definition: CSEInfo.cpp:27
llvm::pdb::DbiModuleDescriptor::operator=
DbiModuleDescriptor & operator=(const DbiModuleDescriptor &Info)=default
llvm::pdb::DbiModuleDescriptor::getPdbFilePathNameIndex
uint32_t getPdbFilePathNameIndex() const
Definition: DbiModuleDescriptor.cpp:72
llvm::pdb::DbiModuleDescriptor::getNumberOfFiles
uint32_t getNumberOfFiles() const
Definition: DbiModuleDescriptor.cpp:64
llvm::pdb::DbiModuleDescriptor::getSymbolDebugInfoByteSize
uint32_t getSymbolDebugInfoByteSize() const
Definition: DbiModuleDescriptor.cpp:52
llvm::VarStreamArrayExtractor< pdb::DbiModuleDescriptor >::operator()
Error operator()(BinaryStreamRef Stream, uint32_t &Length, pdb::DbiModuleDescriptor &Info)
Definition: DbiModuleDescriptor.h:59
llvm::pdb::DbiModuleDescriptor::getC11LineInfoByteSize
uint32_t getC11LineInfoByteSize() const
Definition: DbiModuleDescriptor.cpp:56
BinaryStreamArray.h
llvm::pdb::DbiModuleDescriptor::initialize
static Error initialize(BinaryStreamRef Stream, DbiModuleDescriptor &Info)
Definition: DbiModuleDescriptor.cpp:21
llvm::pdb::DbiModuleDescriptor::getSectionContrib
const SectionContrib & getSectionContrib() const
Definition: DbiModuleDescriptor.cpp:44
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
BinaryStreamRef.h
uint32_t
uint16_t
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::pdb::DbiModuleDescriptor::getModuleStreamIndex
uint16_t getModuleStreamIndex() const
Definition: DbiModuleDescriptor.cpp:48
llvm::pdb::DbiModuleDescriptor::getC13LineInfoByteSize
uint32_t getC13LineInfoByteSize() const
Definition: DbiModuleDescriptor.cpp:60
llvm::pdb::DbiModuleDescriptor::getObjFileName
StringRef getObjFileName() const
Definition: DbiModuleDescriptor.cpp:78
llvm::pdb::DbiModuleDescriptor::getModuleName
StringRef getModuleName() const
Definition: DbiModuleDescriptor.cpp:76
llvm::pdb::DbiModuleDescriptor
Definition: DbiModuleDescriptor.h:23
llvm::BinaryStreamRef
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
Definition: BinaryStreamRef.h:156