Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:44

0001 //===- DbiModuleDescriptor.h - PDB module information -----------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_DEBUGINFO_PDB_NATIVE_DBIMODULEDESCRIPTOR_H
0010 #define LLVM_DEBUGINFO_PDB_NATIVE_DBIMODULEDESCRIPTOR_H
0011 
0012 #include "llvm/ADT/StringRef.h"
0013 #include "llvm/Support/BinaryStreamRef.h"
0014 #include "llvm/Support/Error.h"
0015 #include <cstdint>
0016 
0017 namespace llvm {
0018 template <typename T> struct VarStreamArrayExtractor;
0019 
0020 namespace pdb {
0021 struct ModuleInfoHeader;
0022 struct SectionContrib;
0023 class DbiModuleDescriptor {
0024   friend class DbiStreamBuilder;
0025 
0026 public:
0027   DbiModuleDescriptor() = default;
0028   DbiModuleDescriptor(const DbiModuleDescriptor &Info) = default;
0029   DbiModuleDescriptor &operator=(const DbiModuleDescriptor &Info) = default;
0030 
0031   static Error initialize(BinaryStreamRef Stream, DbiModuleDescriptor &Info);
0032 
0033   bool hasECInfo() const;
0034   uint16_t getTypeServerIndex() const;
0035   uint16_t getModuleStreamIndex() const;
0036   uint32_t getSymbolDebugInfoByteSize() const;
0037   uint32_t getC11LineInfoByteSize() const;
0038   uint32_t getC13LineInfoByteSize() const;
0039   uint32_t getNumberOfFiles() const;
0040   uint32_t getSourceFileNameIndex() const;
0041   uint32_t getPdbFilePathNameIndex() const;
0042 
0043   StringRef getModuleName() const;
0044   StringRef getObjFileName() const;
0045 
0046   uint32_t getRecordLength() const;
0047 
0048   const SectionContrib &getSectionContrib() const;
0049 
0050 private:
0051   StringRef ModuleName;
0052   StringRef ObjFileName;
0053   const ModuleInfoHeader *Layout = nullptr;
0054 };
0055 
0056 } // end namespace pdb
0057 
0058 template <> struct VarStreamArrayExtractor<pdb::DbiModuleDescriptor> {
0059   Error operator()(BinaryStreamRef Stream, uint32_t &Length,
0060                    pdb::DbiModuleDescriptor &Info) {
0061     if (auto EC = pdb::DbiModuleDescriptor::initialize(Stream, Info))
0062       return EC;
0063     Length = Info.getRecordLength();
0064     return Error::success();
0065   }
0066 };
0067 
0068 } // end namespace llvm
0069 
0070 #endif // LLVM_DEBUGINFO_PDB_NATIVE_DBIMODULEDESCRIPTOR_H