LLVM  6.0.0svn
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
llvm::MCFragment Class Reference

#include "llvm/MC/MCFragment.h"

Inheritance diagram for llvm::MCFragment:
Inheritance graph
[legend]
Collaboration diagram for llvm::MCFragment:
Collaboration graph
[legend]

Public Types

enum  FragmentType : uint8_t {
  FT_Align, FT_Data, FT_CompactEncodedInst, FT_Fill,
  FT_Relaxable, FT_Org, FT_Dwarf, FT_DwarfFrame,
  FT_LEB, FT_Padding, FT_SymbolId, FT_CVInlineLines,
  FT_CVDefRange, FT_Dummy
}
 

Public Member Functions

 MCFragment ()=delete
 
 MCFragment (const MCFragment &)=delete
 
MCFragmentoperator= (const MCFragment &)=delete
 
void destroy ()
 Destroys the current fragment. More...
 
FragmentType getKind () const
 
MCSectiongetParent () const
 
void setParent (MCSection *Value)
 
const MCSymbolgetAtom () const
 
void setAtom (const MCSymbol *Value)
 
unsigned getLayoutOrder () const
 
void setLayoutOrder (unsigned Value)
 
bool hasInstructions () const
 Does this fragment have instructions emitted into it? By default this is false, but specific fragment types may set it to true. More...
 
bool alignToBundleEnd () const
 Should this fragment be placed at the end of an aligned bundle? More...
 
void setAlignToBundleEnd (bool V)
 
uint8_t getBundlePadding () const
 Get the padding size that must be inserted before this fragment. More...
 
void setBundlePadding (uint8_t N)
 Set the padding size for this fragment. More...
 
bool isDummy () const
 Return true if given frgment has FT_Dummy type. More...
 
void dump () const
 
- Public Member Functions inherited from llvm::ilist_node_with_parent< MCFragment, MCSection >
MCFragmentgetPrevNode ()
 
const MCFragmentgetPrevNode () const
 Get the previous node, or nullptr for the list head. More...
 
MCFragmentgetNextNode ()
 Get the next node, or nullptr for the list tail. More...
 
const MCFragmentgetNextNode () const
 Get the next node, or nullptr for the list tail. More...
 
- Public Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< MCFragment, Options... >::type >
self_iterator getIterator ()
 
const_self_iterator getIterator () const
 
reverse_self_iterator getReverseIterator ()
 
const_reverse_self_iterator getReverseIterator () const
 
bool isSentinel () const
 Check whether this is the sentinel node. More...
 

Protected Member Functions

 MCFragment (FragmentType Kind, bool HasInstructions, uint8_t BundlePadding, MCSection *Parent=nullptr)
 
 ~MCFragment ()
 
- Protected Member Functions inherited from llvm::ilist_node_with_parent< MCFragment, MCSection >
 ilist_node_with_parent ()=default
 
- Protected Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< MCFragment, Options... >::type >
 ilist_node_impl ()=default
 

Protected Attributes

bool HasInstructions
 

Friends

class MCAsmLayout
 

Additional Inherited Members

- Protected Types inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< MCFragment, Options... >::type >
using self_iterator = ilist_iterator< ilist_detail::compute_node_options< MCFragment, Options... >::type, false, false >
 
using const_self_iterator = ilist_iterator< ilist_detail::compute_node_options< MCFragment, Options... >::type, false, true >
 
using reverse_self_iterator = ilist_iterator< ilist_detail::compute_node_options< MCFragment, Options... >::type, true, false >
 
using const_reverse_self_iterator = ilist_iterator< ilist_detail::compute_node_options< MCFragment, Options... >::type, true, true >
 

Detailed Description

Definition at line 31 of file MCFragment.h.

Member Enumeration Documentation

◆ FragmentType

Enumerator
FT_Align 
FT_Data 
FT_CompactEncodedInst 
FT_Fill 
FT_Relaxable 
FT_Org 
FT_Dwarf 
FT_DwarfFrame 
FT_LEB 
FT_Padding 
FT_SymbolId 
FT_CVInlineLines 
FT_CVDefRange 
FT_Dummy 

Definition at line 35 of file MCFragment.h.

Constructor & Destructor Documentation

◆ MCFragment() [1/3]

MCFragment::MCFragment ( FragmentType  Kind,
bool  HasInstructions,
uint8_t  BundlePadding,
MCSection Parent = nullptr 
)
protected

◆ ~MCFragment()

MCFragment::~MCFragment ( )
protecteddefault

◆ MCFragment() [2/3]

llvm::MCFragment::MCFragment ( )
delete

◆ MCFragment() [3/3]

llvm::MCFragment::MCFragment ( const MCFragment )
delete

Member Function Documentation

◆ alignToBundleEnd()

bool llvm::MCFragment::alignToBundleEnd ( ) const
inline

Should this fragment be placed at the end of an aligned bundle?

Definition at line 118 of file MCFragment.h.

Referenced by llvm::computeBundlePadding(), and llvm::MCAssembler::writeFragmentPadding().

◆ destroy()

void MCFragment::destroy ( )

Destroys the current fragment.

This must be used instead of delete as MCFragment is non-virtual. This method will dispatch to the appropriate subclass.

Definition at line 246 of file MCFragment.cpp.

References FT_Align, FT_CompactEncodedInst, FT_CVDefRange, FT_CVInlineLines, FT_Data, FT_Dummy, FT_Dwarf, FT_DwarfFrame, FT_Fill, FT_LEB, FT_Org, FT_Padding, FT_Relaxable, and FT_SymbolId.

Referenced by llvm::computeBundlePadding().

◆ dump()

LLVM_DUMP_METHOD void MCFragment::dump ( ) const

◆ getAtom()

const MCSymbol* llvm::MCFragment::getAtom ( ) const
inline

◆ getBundlePadding()

uint8_t llvm::MCFragment::getBundlePadding ( ) const
inline

Get the padding size that must be inserted before this fragment.

Used for bundling. By default, no padding is inserted. Note that padding size is restricted to 8 bits. This is an optimization to reduce the amount of space used for each fragment. In practice, larger padding should never be required.

Definition at line 126 of file MCFragment.h.

Referenced by dump(), and llvm::MCAssembler::writeFragmentPadding().

◆ getKind()

FragmentType llvm::MCFragment::getKind ( ) const
inline

◆ getLayoutOrder()

unsigned llvm::MCFragment::getLayoutOrder ( ) const
inline

Definition at line 110 of file MCFragment.h.

Referenced by llvm::MCAsmLayout::MCAsmLayout().

◆ getParent()

MCSection* llvm::MCFragment::getParent ( ) const
inline

◆ hasInstructions()

bool llvm::MCFragment::hasInstructions ( ) const
inline

Does this fragment have instructions emitted into it? By default this is false, but specific fragment types may set it to true.

Definition at line 115 of file MCFragment.h.

References HasInstructions.

Referenced by addData(), dump(), llvm::MCObjectStreamer::getOrCreateDataFragment(), llvm::MCAsmLayout::layoutFragment(), and llvm::MCAssembler::writeFragmentPadding().

◆ isDummy()

bool llvm::MCFragment::isDummy ( ) const
inline

Return true if given frgment has FT_Dummy type.

Definition at line 133 of file MCFragment.h.

References dump(), and FT_Dummy.

Referenced by MCFragment().

◆ operator=()

MCFragment& llvm::MCFragment::operator= ( const MCFragment )
delete

◆ setAlignToBundleEnd()

void llvm::MCFragment::setAlignToBundleEnd ( bool  V)
inline

◆ setAtom()

void llvm::MCFragment::setAtom ( const MCSymbol Value)
inline

Definition at line 108 of file MCFragment.h.

◆ setBundlePadding()

void llvm::MCFragment::setBundlePadding ( uint8_t  N)
inline

Set the padding size for this fragment.

By default it's a no-op, and only some fragments have a meaningful implementation.

Definition at line 130 of file MCFragment.h.

References N.

Referenced by llvm::MCAsmLayout::layoutFragment(), and llvm::MCELFStreamer::MCELFStreamer().

◆ setLayoutOrder()

void llvm::MCFragment::setLayoutOrder ( unsigned  Value)
inline

Definition at line 111 of file MCFragment.h.

◆ setParent()

void llvm::MCFragment::setParent ( MCSection Value)
inline

Friends And Related Function Documentation

◆ MCAsmLayout

friend class MCAsmLayout
friend

Definition at line 32 of file MCFragment.h.

Member Data Documentation

◆ HasInstructions

bool llvm::MCFragment::HasInstructions
protected

Definition at line 56 of file MCFragment.h.

Referenced by hasInstructions(), and llvm::MCDataFragment::setHasInstructions().


The documentation for this class was generated from the following files: