LLVM: lib/MC/MCAssembler.cpp File Reference (original) (raw)
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 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. |
◆ DEBUG_TYPE
#define DEBUG_TYPE "assembler"
◆ getLabelOffset()
◆ getSymbolOffsetImpl()
Definition at line 276 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::reportFatalUsageError().
Referenced by llvm::MCAssembler::getSymbolOffset(), llvm::MCAssembler::getSymbolOffset(), and getSymbolOffsetImpl().
◆ isAgainstBoundary()
Check if the branch is against the boundary.
Parameters
| StartAddr | start address of the fused/unfused branch. |
|---|---|
| Size | size of the fused/unfused branch. |
| BoundaryAlignment | alignment requirement of the branch. |
Returns
true if the branch is against the boundary.
Definition at line 843 of file MCAssembler.cpp.
References Size, and llvm::Align::value().
Referenced by needPadding().
◆ mayCrossBoundary()
Check if the branch crosses the boundary.
Parameters
| StartAddr | start address of the fused/unfused branch. |
|---|---|
| Size | size of the fused/unfused branch. |
| BoundaryAlignment | alignment requirement of the branch. |
Returns
true if the branch cross the boundary.
Definition at line 830 of file MCAssembler.cpp.
References llvm::Log2(), and Size.
Referenced by needPadding().
◆ needPadding()
Check if the branch needs padding.
Parameters
| StartAddr | start address of the fused/unfused branch. |
|---|---|
| Size | size of the fused/unfused branch. |
| BoundaryAlignment | alignment requirement of the branch. |
Returns
true if the branch needs padding.
Definition at line 855 of file MCAssembler.cpp.
References isAgainstBoundary(), mayCrossBoundary(), and Size.
◆ writeFragment()
Write the fragment F to the output file.
Definition at line 384 of file MCAssembler.cpp.
References assert(), llvm::cast(), llvm::Count, llvm::Data, E(), F, llvm::MCFragment::FT_Align, llvm::MCFragment::FT_BoundaryAlign, llvm::MCFragment::FT_CVDefRange, llvm::MCFragment::FT_CVInlineLines, llvm::MCFragment::FT_Data, 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_Relaxable, llvm::MCFragment::FT_SFrame, llvm::MCFragment::FT_SymbolId, llvm::MCNopsFragment::getControlledNopLength(), llvm::MCSymbol::getIndex(), llvm::MCNopsFragment::getLoc(), llvm::MCNopsFragment::getNumBytes(), llvm::MCFragment::getSubtargetInfo(), llvm::MCSymbolIdFragment::getSymbol(), llvm::MCFillFragment::getValue(), llvm::MCFillFragment::getValueSize(), I, llvm::little, llvm_unreachable, llvm::Ref, llvm::report_fatal_error(), llvm::reportFatalInternalError(), llvm::raw_ostream::tell(), llvm::raw_ostream::write(), and llvm::support::endian::write().
Referenced by llvm::MCAssembler::writeSectionData().