[llvm-exegesis] Provide a way to handle memory instructions.
[llvm-core.git] / tools / llvm-readobj / Win64EHDumper.h
blob772f68bf283f722bfb191ada9e1d8f4505d05c47
1 //===- Win64EHDumper.h - Win64 EH Printing ----------------------*- 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 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_TOOLS_LLVM_READOBJ_WIN64EHDUMPER_H
11 #define LLVM_TOOLS_LLVM_READOBJ_WIN64EHDUMPER_H
13 #include "llvm/Support/ScopedPrinter.h"
14 #include "llvm/Support/Win64EH.h"
16 namespace llvm {
17 namespace object {
18 class COFFObjectFile;
19 class SymbolRef;
20 struct coff_section;
23 namespace Win64EH {
24 class Dumper {
25 ScopedPrinter &SW;
26 raw_ostream &OS;
28 public:
29 typedef std::error_code (*SymbolResolver)(const object::coff_section *,
30 uint64_t, object::SymbolRef &,
31 void *);
33 struct Context {
34 const object::COFFObjectFile &COFF;
35 SymbolResolver ResolveSymbol;
36 void *UserData;
38 Context(const object::COFFObjectFile &COFF, SymbolResolver Resolver,
39 void *UserData)
40 : COFF(COFF), ResolveSymbol(Resolver), UserData(UserData) {}
43 private:
44 void printRuntimeFunctionEntry(const Context &Ctx,
45 const object::coff_section *Section,
46 uint64_t SectionOffset,
47 const RuntimeFunction &RF);
48 void printUnwindCode(const UnwindInfo& UI, ArrayRef<UnwindCode> UC);
49 void printUnwindInfo(const Context &Ctx, const object::coff_section *Section,
50 off_t Offset, const UnwindInfo &UI);
51 void printRuntimeFunction(const Context &Ctx,
52 const object::coff_section *Section,
53 uint64_t SectionOffset, const RuntimeFunction &RF);
55 public:
56 Dumper(ScopedPrinter &SW) : SW(SW), OS(SW.getOStream()) {}
58 void printData(const Context &Ctx);
63 #endif