Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
MCAssembler.cpp File Reference
#include "llvm/MC/MCAssembler.h"
#include "llvm/ADT/ArrayRef.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/MCInst.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSFrame.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 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.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "assembler"

Definition at line 47 of file MCAssembler.cpp.

Function Documentation

◆ getLabelOffset()

bool getLabelOffset ( const MCAssembler & Asm,
const MCSymbol & S,
bool ReportError,
uint64_t & Val )
static

◆ getSymbolOffsetImpl()

◆ isAgainstBoundary()

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 843 of file MCAssembler.cpp.

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

Referenced by needPadding().

◆ mayCrossBoundary()

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 830 of file MCAssembler.cpp.

References llvm::Log2(), and Size.

Referenced by needPadding().

◆ needPadding()

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 855 of file MCAssembler.cpp.

References isAgainstBoundary(), mayCrossBoundary(), and Size.

◆ writeFragment()