LLVM  10.0.0
Namespaces | Macros | Functions
MCAssembler.cpp File Reference
#include "llvm/MC/MCAssembler.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCAsmLayout.h"
#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCCodeView.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDwarf.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCFixup.h"
#include "llvm/MC/MCFixupKindInfo.h"
#include "llvm/MC/MCFragment.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCValue.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstdint>
#include <cstring>
#include <tuple>
#include <utility>
Include dependency graph for MCAssembler.cpp:

Go to the source code of this file.

Namespaces

 stats
 

Macros

#define DEBUG_TYPE   "assembler"
 

Functions

static void writeFragment (raw_ostream &OS, const MCAssembler &Asm, const MCAsmLayout &Layout, const MCFragment &F)
 Write the fragment F to the output file. More...
 
static bool mayCrossBoundary (uint64_t StartAddr, uint64_t Size, Align BoundaryAlignment)
 Check if the branch crosses the boundary. More...
 
static bool isAgainstBoundary (uint64_t StartAddr, uint64_t Size, Align BoundaryAlignment)
 Check if the branch is against the boundary. More...
 
static bool needPadding (uint64_t StartAddr, uint64_t Size, Align BoundaryAlignment)
 Check if the branch needs padding. More...
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "assembler"

Definition at line 48 of file MCAssembler.cpp.

Function Documentation

◆ isAgainstBoundary()

static bool isAgainstBoundary ( uint64_t  StartAddr,
uint64_t  Size,
Align  BoundaryAlignment 
)
static

Check if the branch is against the boundary.

Parameters
StartAddrstart address of the fused/unfused branch.
Sizesize of the fused/unfused branch.
BoundaryAlignmentalignment requirement of the branch.
Returns
true if the branch is against the boundary.

Definition at line 979 of file MCAssembler.cpp.

References Size, and llvm::Align::value().

Referenced by needPadding().

◆ mayCrossBoundary()

static bool mayCrossBoundary ( uint64_t  StartAddr,
uint64_t  Size,
Align  BoundaryAlignment 
)
static

Check if the branch crosses the boundary.

Parameters
StartAddrstart address of the fused/unfused branch.
Sizesize of the fused/unfused branch.
BoundaryAlignmentalignment requirement of the branch.
Returns
true if the branch cross the boundary.

Definition at line 966 of file MCAssembler.cpp.

References llvm::Log2(), and Size.

Referenced by needPadding().

◆ needPadding()

static bool needPadding ( uint64_t  StartAddr,
uint64_t  Size,
Align  BoundaryAlignment 
)
static

Check if the branch needs padding.

Parameters
StartAddrstart address of the fused/unfused branch.
Sizesize of the fused/unfused branch.
BoundaryAlignmentalignment requirement of the branch.
Returns
true if the branch needs padding.

Definition at line 991 of file MCAssembler.cpp.

References assert(), llvm::MCSection::begin(), llvm::MCAssembler::begin(), llvm::MCBoundaryAlignFragment::canEmitNops(), llvm::SmallVectorImpl< T >::clear(), llvm::MCAssembler::computeFragmentSize(), llvm::MCFixup::create(), llvm::Data, llvm::MCDwarfLineAddr::Encode(), llvm::MCDwarfFrameEmitter::EncodeAdvanceLoc(), llvm::CodeViewContext::encodeDefRange(), llvm::CodeViewContext::encodeInlineLineTable(), llvm::MCSection::end(), llvm::MCAssembler::end(), llvm::MCExpr::evaluateKnownAbsolute(), F(), llvm::MCAsmBackend::finishLayout(), llvm::MCDwarfLineAddr::FixedEncode(), llvm::MCFragment::FT_BoundaryAlign, llvm::MCFragment::FT_CVDefRange, llvm::MCFragment::FT_CVInlineLines, llvm::MCFragment::FT_Dwarf, llvm::MCFragment::FT_DwarfFrame, llvm::MCFragment::FT_LEB, llvm::MCFragment::FT_Relaxable, llvm::MCDwarfLineAddrFragment::getAddrDelta(), llvm::MCDwarfCallFrameFragment::getAddrDelta(), llvm::MCBoundaryAlignFragment::getAlignment(), llvm::MCAsmLayout::getAssembler(), llvm::MCAssembler::getBackend(), llvm::MCAssembler::getBackendPtr(), llvm::MCEncodedFragmentWithContents< ContentsSize >::getContents(), llvm::MCCVInlineLineTableFragment::getContents(), llvm::MCAssembler::getContext(), llvm::MCContext::getCVContext(), llvm::MCAssembler::getDWARFLinetableParams(), llvm::MCEncodedFragmentWithFixups< ContentsSize, FixupsSize >::getFixups(), llvm::MCSection::getFragmentList(), llvm::MCAsmLayout::getFragmentOffset(), llvm::MCFixup::getKindForSize(), llvm::MCFixup::getKindForSizeInBits(), llvm::MCBinaryExpr::getLHS(), llvm::MCDwarfLineAddrFragment::getLineDelta(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), llvm::MCAssembler::getRelaxAll(), llvm::MCAsmLayout::getSectionOrder(), llvm::MCBoundaryAlignFragment::getSize(), I, llvm::ARM_PROC::IE, llvm::MCAsmLayout::invalidateFragmentsFrom(), isAgainstBoundary(), llvm::MCBoundaryAlignFragment::isFused(), mayCrossBoundary(), N, llvm::offsetToAlignment(), llvm::ARMBuildAttrs::Section, llvm::MCBoundaryAlignFragment::setSize(), Size, and llvm::SmallVectorBase::size().

◆ writeFragment()

static void writeFragment ( raw_ostream &  OS,
const MCAssembler &  Asm,
const MCAsmLayout &  Layout,
const MCFragment &  F 
)
static