llir-opt  0.0.1
Low-Level Post-Link Optimiser for OCaml and C
ppcannot_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 
9 
10 
14 class PPCAnnotPrinter final : public AnnotPrinter {
15 public:
16  static char ID;
17 
20  llvm::MCContext *ctx,
21  llvm::MCStreamer *os,
22  const llvm::MCObjectFileInfo *objInfo,
23  const llvm::DataLayout &layout,
24  const ISelMapping &mapping,
25  bool shared
26  );
27 
30 
32  llvm::StringRef getPassName() const override;
33 
34 private:
36  std::optional<unsigned> GetRegisterIndex(llvm::Register reg) override;
38  llvm::StringRef GetRegisterName(unsigned reg) override;
40  llvm::Register GetStackPointer() override;
42  unsigned GetImplicitStackSize() const override { return 0; }
44  int64_t GetFrameOffset(const llvm::MachineInstr &MI) const override;
45 };
PPCAnnotPrinter::getPassName
llvm::StringRef getPassName() const override
Hardcoded name.
Definition: ppcannot_printer.cpp:113
ISelMapping
Definition: isel_mapping.h:22
AnnotPrinter
Definition: annot_printer.h:47
ID
Definition: id.h:19
PPCAnnotPrinter
Definition: ppcannot_printer.h:14
PPCAnnotPrinter::PPCAnnotPrinter
PPCAnnotPrinter(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: ppcannot_printer.cpp:32
PPCAnnotPrinter::~PPCAnnotPrinter
~PPCAnnotPrinter()
Cleanup.
Definition: ppcannot_printer.cpp:44