1 //===- DbiModuleDescriptor.h - PDB module information -----------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_DEBUGINFO_PDB_RAW_DBIMODULEDESCRIPTOR_H
10 #define LLVM_DEBUGINFO_PDB_RAW_DBIMODULEDESCRIPTOR_H
12 #include "llvm/ADT/StringRef.h"
13 #include "llvm/DebugInfo/PDB/Native/RawTypes.h"
14 #include "llvm/Support/BinaryStreamArray.h"
15 #include "llvm/Support/BinaryStreamRef.h"
16 #include "llvm/Support/Error.h"
24 class DbiModuleDescriptor
{
25 friend class DbiStreamBuilder
;
28 DbiModuleDescriptor();
29 DbiModuleDescriptor(const DbiModuleDescriptor
&Info
);
30 ~DbiModuleDescriptor();
32 static Error
initialize(BinaryStreamRef Stream
, DbiModuleDescriptor
&Info
);
34 bool hasECInfo() const;
35 uint16_t getTypeServerIndex() const;
36 uint16_t getModuleStreamIndex() const;
37 uint32_t getSymbolDebugInfoByteSize() const;
38 uint32_t getC11LineInfoByteSize() const;
39 uint32_t getC13LineInfoByteSize() const;
40 uint32_t getNumberOfFiles() const;
41 uint32_t getSourceFileNameIndex() const;
42 uint32_t getPdbFilePathNameIndex() const;
44 StringRef
getModuleName() const;
45 StringRef
getObjFileName() const;
47 uint32_t getRecordLength() const;
49 const SectionContrib
&getSectionContrib() const;
53 StringRef ObjFileName
;
54 const ModuleInfoHeader
*Layout
= nullptr;
57 } // end namespace pdb
59 template <> struct VarStreamArrayExtractor
<pdb::DbiModuleDescriptor
> {
60 Error
operator()(BinaryStreamRef Stream
, uint32_t &Length
,
61 pdb::DbiModuleDescriptor
&Info
) {
62 if (auto EC
= pdb::DbiModuleDescriptor::initialize(Stream
, Info
))
64 Length
= Info
.getRecordLength();
65 return Error::success();
69 } // end namespace llvm
71 #endif // LLVM_DEBUGINFO_PDB_RAW_DBIMODULEDESCRIPTOR_H