LLVM  7.0.0
Nios2AsmBackend.h
Go to the documentation of this file.
1 //===-- Nios2AsmBackend.h - Nios2 Asm Backend ----------------------------===//
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 defines the Nios2AsmBackend class.
11 //
12 //===----------------------------------------------------------------------===//
13 //
14 
15 #ifndef LLVM_LIB_TARGET_NIOS2_MCTARGETDESC_NIOS2ASMBACKEND_H
16 #define LLVM_LIB_TARGET_NIOS2_MCTARGETDESC_NIOS2ASMBACKEND_H
17 
19 #include "llvm/ADT/Triple.h"
20 #include "llvm/MC/MCAsmBackend.h"
21 
22 namespace llvm {
23 
24 class MCAssembler;
25 struct MCFixupKindInfo;
26 class Target;
27 class MCObjectWriter;
28 
29 class Nios2AsmBackend : public MCAsmBackend {
30  Triple::OSType OSType;
31 
32 public:
34  : MCAsmBackend(support::little), OSType(OSType) {}
35 
36  std::unique_ptr<MCObjectTargetWriter>
37  createObjectTargetWriter() const override;
38 
39  bool writeNopData(raw_ostream &OS, uint64_t Count) const override;
40 
41  void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
43  uint64_t Value, bool IsResolved) const override;
44 
46  const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const override;
47 
48  unsigned getNumFixupKinds() const override {
50  }
51 
52  /// MayNeedRelaxation - Check whether the given instruction may need
53  /// relaxation.
54  ///
55  /// \param Inst - The instruction to test.
56  bool mayNeedRelaxation(const MCInst &Inst) const override { return false; }
57 
58  /// fixupNeedsRelaxation - Target specific predicate for whether a given
59  /// fixup requires the associated instruction to be relaxed.
60  bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value,
61  const MCRelaxableFragment *DF,
62  const MCAsmLayout &Layout) const override {
63  // FIXME.
64  llvm_unreachable("RelaxInstruction() unimplemented");
65  return false;
66  }
67 
68  /// RelaxInstruction - Relax the instruction in the given fragment
69  /// to the next wider instruction.
70  ///
71  /// \param Inst - The instruction to relax, which may be the same
72  /// as the output.
73  /// \param [out] Res On return, the relaxed instruction.
74  void relaxInstruction(const MCInst &Inst, const MCSubtargetInfo &STI,
75  MCInst &Res) const override {}
76 
77 }; // class Nios2AsmBackend
78 
79 } // namespace llvm
80 
81 #endif
bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value, const MCRelaxableFragment *DF, const MCAsmLayout &Layout) const override
fixupNeedsRelaxation - Target specific predicate for whether a given fixup requires the associated in...
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
This represents an "assembler immediate".
Definition: MCValue.h:40
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:74
Encapsulates the layout of an assembly file at a particular point in time.
Definition: MCAsmLayout.h:29
Nios2AsmBackend(const Target &T, Triple::OSType OSType)
void relaxInstruction(const MCInst &Inst, const MCSubtargetInfo &STI, MCInst &Res) const override
RelaxInstruction - Relax the instruction in the given fragment to the next wider instruction.
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:161
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
Definition: MCFragment.h:271
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
Definition: ArrayRef.h:291
MCFixupKind
Extensible enumeration to represent the type of a fixup.
Definition: MCFixup.h:23
void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup, const MCValue &Target, MutableArrayRef< char > Data, uint64_t Value, bool IsResolved) const override
ApplyFixup - Apply the Value for given Fixup into the provided data fragment, at the offset specified...
unsigned getNumFixupKinds() const override
Get the number of target specific fixup kinds.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
PowerPC TLS Dynamic Call Fixup
Target - Wrapper for Target specific information.
std::unique_ptr< MCObjectTargetWriter > createObjectTargetWriter() const override
bool mayNeedRelaxation(const MCInst &Inst) const override
MayNeedRelaxation - Check whether the given instruction may need relaxation.
Generic base class for all target subtargets.
bool writeNopData(raw_ostream &OS, uint64_t Count) const override
Write an (optimal) nop sequence of Count bytes to the given output.
Target independent information on a fixup kind.
const unsigned Kind
LLVM Value Representation.
Definition: Value.h:73
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:42
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:46
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
Optional< MCFixupKind > getFixupKind(StringRef Name) const override
Map a relocation name used in .reloc to a fixup kind.
const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const override
Get information on a fixup kind.