Recommit [NFC] Better encapsulation of llvm::Optional Storage
[llvm-complete.git] / include / llvm / DebugInfo / Symbolize / SymbolizableModule.h
blobf0862d0b85d2b74e83695c5b2ce46250ded1ee20
1 //===- SymbolizableModule.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 //===----------------------------------------------------------------------===//
8 //
9 // This file declares the SymbolizableModule interface.
11 //===----------------------------------------------------------------------===//
12 #ifndef LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZABLEMODULE_H
13 #define LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZABLEMODULE_H
15 #include "llvm/DebugInfo/DIContext.h"
16 #include <cstdint>
18 namespace llvm {
19 namespace symbolize {
21 using FunctionNameKind = DILineInfoSpecifier::FunctionNameKind;
23 class SymbolizableModule {
24 public:
25 virtual ~SymbolizableModule() = default;
27 virtual DILineInfo symbolizeCode(uint64_t ModuleOffset,
28 FunctionNameKind FNKind,
29 bool UseSymbolTable) const = 0;
30 virtual DIInliningInfo symbolizeInlinedCode(uint64_t ModuleOffset,
31 FunctionNameKind FNKind,
32 bool UseSymbolTable) const = 0;
33 virtual DIGlobal symbolizeData(uint64_t ModuleOffset) const = 0;
35 // Return true if this is a 32-bit x86 PE COFF module.
36 virtual bool isWin32Module() const = 0;
38 // Returns the preferred base of the module, i.e. where the loader would place
39 // it in memory assuming there were no conflicts.
40 virtual uint64_t getModulePreferredBase() const = 0;
43 } // end namespace symbolize
44 } // end namespace llvm
46 #endif // LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZABLEMODULE_H