llvm/llvm/include/llvm/MC/MCFragment.h

//===- MCFragment.h - Fragment type hierarchy -------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_MC_MCFRAGMENT_H
#define LLVM_MC_MCFRAGMENT_H

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/ilist_node.h"
#include "llvm/MC/MCFixup.h"
#include "llvm/MC/MCInst.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/SMLoc.h"
#include <cstdint>
#include <utility>

namespace llvm {

class MCAssembler;
class MCObjectStreamer;
class MCSection;
class MCSubtargetInfo;
class MCSymbol;

class MCFragment {};

class MCDummyFragment : public MCFragment {};

/// Interface implemented by fragments that contain encoded instructions and/or
/// data.
///
class MCEncodedFragment : public MCFragment {};

/// Interface implemented by fragments that contain encoded instructions and/or
/// data and also have fixups registered.
///
template <unsigned ContentsSize, unsigned FixupsSize>
class MCEncodedFragmentWithFixups : public MCEncodedFragment {};

/// Fragment for data and encoded instructions.
///
class MCDataFragment : public MCEncodedFragmentWithFixups<32, 4> {};

/// A relaxable fragment holds on to its MCInst, since it may need to be
/// relaxed during the assembler layout and relaxation stage.
///
class MCRelaxableFragment : public MCEncodedFragmentWithFixups<8, 1> {};

class MCAlignFragment : public MCFragment {};

class MCFillFragment : public MCFragment {};

class MCNopsFragment : public MCFragment {};

class MCOrgFragment : public MCFragment {};

class MCLEBFragment final : public MCEncodedFragmentWithFixups<8, 0> {};

class MCDwarfLineAddrFragment : public MCEncodedFragmentWithFixups<8, 1> {};

class MCDwarfCallFrameFragment : public MCEncodedFragmentWithFixups<8, 1> {};

/// Represents a symbol table index fragment.
class MCSymbolIdFragment : public MCFragment {};

/// Fragment representing the binary annotations produced by the
/// .cv_inline_linetable directive.
class MCCVInlineLineTableFragment : public MCFragment {};

/// Fragment representing the .cv_def_range directive.
class MCCVDefRangeFragment : public MCEncodedFragmentWithFixups<32, 4> {};

/// Represents required padding such that a particular other set of fragments
/// does not cross a particular power-of-two boundary. The other fragments must
/// follow this one within the same section.
class MCBoundaryAlignFragment : public MCFragment {};

class MCPseudoProbeAddrFragment : public MCEncodedFragmentWithFixups<8, 1> {};
} // end namespace llvm

#endif // LLVM_MC_MCFRAGMENT_H