LLVM 23.0.0git
X86MCLFIRewriter.h
Go to the documentation of this file.
1//===- X86MCLFIRewriter.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 X86MCLFIRewriter class, the X86 specific
10// subclass of MCLFIRewriter.
11//
12//===----------------------------------------------------------------------===//
13#ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCLFIREWRITER_H
14#define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCLFIREWRITER_H
15
16#include "llvm/MC/MCInstrInfo.h"
19
20namespace llvm {
21class MCContext;
22class MCInst;
23class MCStreamer;
24class MCSubtargetInfo;
25
26namespace X86 {
27
29public:
30 X86MCLFIRewriter(MCContext &Ctx, std::unique_ptr<MCRegisterInfo> &&RI,
31 std::unique_ptr<MCInstrInfo> &&II)
32 : MCLFIRewriter(Ctx, std::move(RI), std::move(II)) {}
33
34 bool rewriteInst(const MCInst &Inst, MCStreamer &Out,
35 const MCSubtargetInfo &STI) override;
36
37private:
38 /// Recursion guard to prevent infinite loops when emitting instructions.
39 bool Guard = false;
40
41 void doRewriteInst(const MCInst &Inst, MCStreamer &Out,
42 const MCSubtargetInfo &STI);
43
44 void rewriteSyscall(const MCInst &Inst, MCStreamer &Out,
45 const MCSubtargetInfo &STI);
46
47 bool isFSAccess(const MCInst &Inst);
48 void rewriteFSAccess(const MCInst &Inst, MCStreamer &Out,
49 const MCSubtargetInfo &STI);
50};
51
52} // namespace X86
53} // namespace llvm
54#endif // LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCLFIREWRITER_H
This file declares the MCLFIRewriter class, an abstract class that encapsulates the rewriting logic f...
uint64_t IntrinsicInst * II
Context object for machine code objects.
Definition MCContext.h:83
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:188
MCLFIRewriter(MCContext &Ctx, std::unique_ptr< MCRegisterInfo > &&RI, std::unique_ptr< MCInstrInfo > &&II)
Streaming machine code generation interface.
Definition MCStreamer.h:222
Generic base class for all target subtargets.
X86MCLFIRewriter(MCContext &Ctx, std::unique_ptr< MCRegisterInfo > &&RI, std::unique_ptr< MCInstrInfo > &&II)
bool rewriteInst(const MCInst &Inst, MCStreamer &Out, const MCSubtargetInfo &STI) override
Define some predicates that are used for node matching.
This is an optimization pass for GlobalISel generic memory operations.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1917
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:860