Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //===- PDBStringTable.h - PDB String Table -----------------------*- 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_PDBSTRINGTABLE_H
0010 #define LLVM_DEBUGINFO_PDB_NATIVE_PDBSTRINGTABLE_H
0011 
0012 #include "llvm/ADT/StringRef.h"
0013 #include "llvm/DebugInfo/CodeView/DebugStringTableSubsection.h"
0014 #include "llvm/Support/BinaryStreamArray.h"
0015 #include "llvm/Support/Endian.h"
0016 #include "llvm/Support/Error.h"
0017 #include <cstdint>
0018 
0019 namespace llvm {
0020 class BinaryStreamReader;
0021 
0022 namespace pdb {
0023 
0024 struct PDBStringTableHeader;
0025 
0026 class PDBStringTable {
0027 public:
0028   Error reload(BinaryStreamReader &Reader);
0029 
0030   uint32_t getByteSize() const;
0031   uint32_t getNameCount() const;
0032   uint32_t getHashVersion() const;
0033   uint32_t getSignature() const;
0034 
0035   Expected<StringRef> getStringForID(uint32_t ID) const;
0036   Expected<uint32_t> getIDForString(StringRef Str) const;
0037 
0038   FixedStreamArray<support::ulittle32_t> name_ids() const;
0039 
0040   const codeview::DebugStringTableSubsectionRef &getStringTable() const;
0041 
0042 private:
0043   Error readHeader(BinaryStreamReader &Reader);
0044   Error readStrings(BinaryStreamReader &Reader);
0045   Error readHashTable(BinaryStreamReader &Reader);
0046   Error readEpilogue(BinaryStreamReader &Reader);
0047 
0048   const PDBStringTableHeader *Header = nullptr;
0049   codeview::DebugStringTableSubsectionRef Strings;
0050   FixedStreamArray<support::ulittle32_t> IDs;
0051   uint32_t NameCount = 0;
0052 };
0053 
0054 } // end namespace pdb
0055 } // end namespace llvm
0056 
0057 #endif // LLVM_DEBUGINFO_PDB_NATIVE_PDBSTRINGTABLE_H