[InstCombine] Signed saturation patterns
[llvm-complete.git] / include / llvm / DebugInfo / PDB / Native / PDBStringTable.h
blob57f0b64a32a681ce9b2677495ef91aa1e042b14d
1 //===- PDBStringTable.h - PDB String Table -----------------------*- 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 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_DEBUGINFO_PDB_RAW_PDBSTRINGTABLE_H
10 #define LLVM_DEBUGINFO_PDB_RAW_PDBSTRINGTABLE_H
12 #include "llvm/ADT/ArrayRef.h"
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/DebugInfo/CodeView/DebugStringTableSubsection.h"
15 #include "llvm/Support/BinaryStreamArray.h"
16 #include "llvm/Support/BinaryStreamRef.h"
17 #include "llvm/Support/Endian.h"
18 #include "llvm/Support/Error.h"
19 #include <cstdint>
20 #include <vector>
22 namespace llvm {
23 class BinaryStreamReader;
25 namespace msf {
26 class MappedBlockStream;
29 namespace pdb {
31 struct PDBStringTableHeader;
33 class PDBStringTable {
34 public:
35 Error reload(BinaryStreamReader &Reader);
37 uint32_t getByteSize() const;
38 uint32_t getNameCount() const;
39 uint32_t getHashVersion() const;
40 uint32_t getSignature() const;
42 Expected<StringRef> getStringForID(uint32_t ID) const;
43 Expected<uint32_t> getIDForString(StringRef Str) const;
45 FixedStreamArray<support::ulittle32_t> name_ids() const;
47 const codeview::DebugStringTableSubsectionRef &getStringTable() const;
49 private:
50 Error readHeader(BinaryStreamReader &Reader);
51 Error readStrings(BinaryStreamReader &Reader);
52 Error readHashTable(BinaryStreamReader &Reader);
53 Error readEpilogue(BinaryStreamReader &Reader);
55 const PDBStringTableHeader *Header = nullptr;
56 codeview::DebugStringTableSubsectionRef Strings;
57 FixedStreamArray<support::ulittle32_t> IDs;
58 uint32_t NameCount = 0;
61 } // end namespace pdb
62 } // end namespace llvm
64 #endif // LLVM_DEBUGINFO_PDB_RAW_STRINGTABLE_H