[Alignment][NFC] Migrate Instructions to Align
[llvm-core.git] / include / llvm / DebugInfo / PDB / PDBContext.h
blob7b6793f0a639a05f15e29488a74ea1f386d23793
1 //===-- PDBContext.h --------------------------------------------*- 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_PDBCONTEXT_H
10 #define LLVM_DEBUGINFO_PDB_PDBCONTEXT_H
12 #include "llvm/DebugInfo/DIContext.h"
13 #include "llvm/DebugInfo/PDB/IPDBSession.h"
14 #include <cstdint>
15 #include <memory>
16 #include <string>
18 namespace llvm {
20 namespace object {
21 class COFFObjectFile;
22 } // end namespace object
24 namespace pdb {
26 /// PDBContext
27 /// This data structure is the top level entity that deals with PDB debug
28 /// information parsing. This data structure exists only when there is a
29 /// need for a transparent interface to different debug information formats
30 /// (e.g. PDB and DWARF). More control and power over the debug information
31 /// access can be had by using the PDB interfaces directly.
32 class PDBContext : public DIContext {
33 public:
34 PDBContext(const object::COFFObjectFile &Object,
35 std::unique_ptr<IPDBSession> PDBSession);
36 PDBContext(PDBContext &) = delete;
37 PDBContext &operator=(PDBContext &) = delete;
39 static bool classof(const DIContext *DICtx) {
40 return DICtx->getKind() == CK_PDB;
43 void dump(raw_ostream &OS, DIDumpOptions DIDumpOpts) override;
45 DILineInfo getLineInfoForAddress(
46 object::SectionedAddress Address,
47 DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
48 DILineInfoTable getLineInfoForAddressRange(
49 object::SectionedAddress Address, uint64_t Size,
50 DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
51 DIInliningInfo getInliningInfoForAddress(
52 object::SectionedAddress Address,
53 DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
55 std::vector<DILocal>
56 getLocalsForAddress(object::SectionedAddress Address) override;
58 private:
59 std::string getFunctionName(uint64_t Address, DINameKind NameKind) const;
60 std::unique_ptr<IPDBSession> Session;
63 } // end namespace pdb
65 } // end namespace llvm
67 #endif // LLVM_DEBUGINFO_PDB_PDBCONTEXT_H