llir-opt  0.0.1
Low-Level Post-Link Optimiser for OCaml and C
x86annot_printer.h
1 // This file if part of the llir-opt project.
2 // Licensing information can be found in the LICENSE file.
3 // (C) 2018 Nandor Licker. All rights reserved.
4 
5 #pragma once
6 
7 #include "emitter/annot_printer.h"
8 
12 class X86AnnotPrinter final : public AnnotPrinter {
13 public:
14  static char ID;
15 
18  llvm::MCContext *ctx,
19  llvm::MCStreamer *os,
20  const llvm::MCObjectFileInfo *objInfo,
21  const llvm::DataLayout &layout,
22  const ISelMapping &mapping,
23  bool shared
24  );
25 
28 
30  llvm::StringRef getPassName() const override;
31 
32 private:
34  std::optional<unsigned> GetRegisterIndex(llvm::Register reg) override;
36  llvm::StringRef GetRegisterName(unsigned reg) override;
38  llvm::Register GetStackPointer() override;
40  unsigned GetImplicitStackSize() const override { return 8; }
41 };
X86AnnotPrinter
Definition: x86annot_printer.h:12
ISelMapping
Definition: isel_mapping.h:22
AnnotPrinter
Definition: annot_printer.h:47
ID
Definition: id.h:19
X86AnnotPrinter::getPassName
llvm::StringRef getPassName() const override
Hardcoded name.
Definition: x86annot_printer.cpp:81
X86AnnotPrinter::X86AnnotPrinter
X86AnnotPrinter(llvm::MCContext *ctx, llvm::MCStreamer *os, const llvm::MCObjectFileInfo *objInfo, const llvm::DataLayout &layout, const ISelMapping &mapping, bool shared)
Initialises the pass which prints data sections.
Definition: x86annot_printer.cpp:30
X86AnnotPrinter::~X86AnnotPrinter
~X86AnnotPrinter()
Cleanup.
Definition: x86annot_printer.cpp:42