1 //===- DbiModuleDescriptor.h - PDB module information -----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_PDB_RAW_DBIMODULEDESCRIPTOR_H
11 #define LLVM_DEBUGINFO_PDB_RAW_DBIMODULEDESCRIPTOR_H
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/DebugInfo/PDB/Native/RawTypes.h"
15 #include "llvm/Support/BinaryStreamArray.h"
16 #include "llvm/Support/BinaryStreamRef.h"
17 #include "llvm/Support/Error.h"
25 class DbiModuleDescriptor {
26 friend class DbiStreamBuilder;
29 DbiModuleDescriptor();
30 DbiModuleDescriptor(const DbiModuleDescriptor &Info);
31 ~DbiModuleDescriptor();
33 static Error initialize(BinaryStreamRef Stream, DbiModuleDescriptor &Info);
35 bool hasECInfo() const;
36 uint16_t getTypeServerIndex() const;
37 uint16_t getModuleStreamIndex() const;
38 uint32_t getSymbolDebugInfoByteSize() const;
39 uint32_t getC11LineInfoByteSize() const;
40 uint32_t getC13LineInfoByteSize() const;
41 uint32_t getNumberOfFiles() const;
42 uint32_t getSourceFileNameIndex() const;
43 uint32_t getPdbFilePathNameIndex() const;
45 StringRef getModuleName() const;
46 StringRef getObjFileName() const;
48 uint32_t getRecordLength() const;
50 const SectionContrib &getSectionContrib() const;
54 StringRef ObjFileName;
55 const ModuleInfoHeader *Layout = nullptr;
58 } // end namespace pdb
60 template <> struct VarStreamArrayExtractor<pdb::DbiModuleDescriptor> {
61 Error operator()(BinaryStreamRef Stream, uint32_t &Length,
62 pdb::DbiModuleDescriptor &Info) {
63 if (auto EC = pdb::DbiModuleDescriptor::initialize(Stream, Info))
65 Length = Info.getRecordLength();
66 return Error::success();
70 } // end namespace llvm
72 #endif // LLVM_DEBUGINFO_PDB_RAW_DBIMODULEDESCRIPTOR_H