[LLVMSymbolize] Move printing the description of a global into a separate function...
[oota-llvm.git] / include / llvm / DebugInfo / Symbolize / SymbolizableModule.h
1 //===-- SymbolizableModule.h ------------------------------------ C++ -----===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the SymbolizableModule interface.
11 //
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZABLEMODULE_H
14 #define LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZABLEMODULE_H
15
16 #include "llvm/DebugInfo/DIContext.h"
17 #include <memory>
18 #include <string>
19
20 namespace llvm {
21 namespace object {
22 class ObjectFile;
23 }
24 }
25
26 namespace llvm {
27 namespace symbolize {
28
29 using FunctionNameKind = DILineInfoSpecifier::FunctionNameKind;
30
31 class SymbolizableModule {
32 public:
33   virtual ~SymbolizableModule() {}
34   virtual DILineInfo symbolizeCode(uint64_t ModuleOffset,
35                                    FunctionNameKind FNKind,
36                                    bool UseSymbolTable) const = 0;
37   virtual DIInliningInfo symbolizeInlinedCode(uint64_t ModuleOffset,
38                                               FunctionNameKind FNKind,
39                                               bool UseSymbolTable) const = 0;
40   virtual DIGlobal symbolizeData(uint64_t ModuleOffset) const = 0;
41
42   // Return true if this is a 32-bit x86 PE COFF module.
43   virtual bool isWin32Module() const = 0;
44
45   // Returns the preferred base of the module, i.e. where the loader would place
46   // it in memory assuming there were no conflicts.
47   virtual uint64_t getModulePreferredBase() const = 0;
48 };
49
50 }  // namespace symbolize
51 }  // namespace llvm
52
53 #endif  // LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZABLEMODULE_H