LLVM 20.0.0git
|
#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/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/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/EndianStream.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstdint>
#include <tuple>
#include <utility>
Go to the source code of this file.
Namespaces | |
namespace | llvm |
This is an optimization pass for GlobalISel generic memory operations. | |
namespace | stats |
Macros | |
#define | DEBUG_TYPE "assembler" |
Functions | |
static uint64_t | computeBundlePadding (unsigned BundleSize, const MCEncodedFragment *F, uint64_t FOffset, uint64_t FSize) |
static bool | getLabelOffset (const MCAssembler &Asm, const MCSymbol &S, bool ReportError, uint64_t &Val) |
static bool | getSymbolOffsetImpl (const MCAssembler &Asm, const MCSymbol &S, bool ReportError, uint64_t &Val) |
static void | writeFragment (raw_ostream &OS, const MCAssembler &Asm, const MCFragment &F) |
Write the fragment F to the output file. | |
static bool | mayCrossBoundary (uint64_t StartAddr, uint64_t Size, Align BoundaryAlignment) |
Check if the branch crosses the boundary. | |
static bool | isAgainstBoundary (uint64_t StartAddr, uint64_t Size, Align BoundaryAlignment) |
Check if the branch is against the boundary. | |
static bool | needPadding (uint64_t StartAddr, uint64_t Size, Align BoundaryAlignment) |
Check if the branch needs padding. | |
#define DEBUG_TYPE "assembler" |
Definition at line 49 of file MCAssembler.cpp.
|
static |
Definition at line 346 of file MCAssembler.cpp.
References F.
Referenced by llvm::MCAssembler::layoutBundle().
|
static |
Definition at line 447 of file MCAssembler.cpp.
References llvm::MCSymbol::getFragment(), llvm::MCSymbol::getName(), llvm::MCSymbol::getOffset(), and llvm::report_fatal_error().
Referenced by getSymbolOffsetImpl().
|
static |
Definition at line 459 of file MCAssembler.cpp.
References A, B, llvm::MCExpr::evaluateAsValue(), getLabelOffset(), llvm::MCSymbol::getName(), getSymbolOffsetImpl(), llvm::MCSymbol::getVariableValue(), llvm::MCSymbol::isVariable(), llvm::Offset, and llvm::report_fatal_error().
Referenced by llvm::MCAssembler::getSymbolOffset(), and getSymbolOffsetImpl().
Check if the branch is against the boundary.
StartAddr | start address of the fused/unfused branch. |
Size | size of the fused/unfused branch. |
BoundaryAlignment | alignment requirement of the branch. |
Definition at line 1152 of file MCAssembler.cpp.
References Size, and llvm::Align::value().
Referenced by needPadding().
Check if the branch crosses the boundary.
StartAddr | start address of the fused/unfused branch. |
Size | size of the fused/unfused branch. |
BoundaryAlignment | alignment requirement of the branch. |
Definition at line 1139 of file MCAssembler.cpp.
References llvm::Log2(), and Size.
Referenced by needPadding().
Check if the branch needs padding.
StartAddr | start address of the fused/unfused branch. |
Size | size of the fused/unfused branch. |
BoundaryAlignment | alignment requirement of the branch. |
Definition at line 1164 of file MCAssembler.cpp.
References isAgainstBoundary(), mayCrossBoundary(), and Size.
|
static |
Write the fragment F
to the output file.
Definition at line 602 of file MCAssembler.cpp.
References assert(), llvm::Data, Endian, F, llvm::MCFragment::FT_Align, llvm::MCFragment::FT_BoundaryAlign, llvm::MCFragment::FT_CVDefRange, llvm::MCFragment::FT_CVInlineLines, llvm::MCFragment::FT_Data, llvm::MCFragment::FT_Dummy, llvm::MCFragment::FT_Dwarf, llvm::MCFragment::FT_DwarfFrame, llvm::MCFragment::FT_Fill, llvm::MCFragment::FT_LEB, llvm::MCFragment::FT_Nops, llvm::MCFragment::FT_Org, llvm::MCFragment::FT_PseudoProbe, llvm::MCFragment::FT_Relaxable, llvm::MCFragment::FT_SymbolId, llvm::MCEncodedFragmentWithFixups< ContentsSize, FixupsSize >::getContents(), llvm::MCNopsFragment::getControlledNopLength(), llvm::MCSymbol::getIndex(), llvm::MCNopsFragment::getLoc(), llvm::MCNopsFragment::getNumBytes(), llvm::MCAlignFragment::getSubtargetInfo(), llvm::MCNopsFragment::getSubtargetInfo(), llvm::MCBoundaryAlignFragment::getSubtargetInfo(), llvm::MCSymbolIdFragment::getSymbol(), llvm::MCAlignFragment::getValue(), llvm::MCFillFragment::getValue(), llvm::MCOrgFragment::getValue(), llvm::MCAlignFragment::getValueSize(), llvm::MCFillFragment::getValueSize(), llvm::MCAlignFragment::hasEmitNops(), I, llvm::little, llvm_unreachable, OS, llvm::Ref, llvm::report_fatal_error(), llvm::raw_ostream::tell(), and llvm::raw_ostream::write().
Referenced by llvm::MCAssembler::writeSectionData().