LLVM 20.0.0git
Static Public Member Functions | List of all members
llvm::MCConstantExpr Class Reference

#include "llvm/MC/MCExpr.h"

Inheritance diagram for llvm::MCConstantExpr:
Inheritance graph
[legend]

Public Member Functions

Accessors
int64_t getValue () const
 
unsigned getSizeInBytes () const
 
bool useHexFormat () const
 
- Public Member Functions inherited from llvm::MCExpr
 MCExpr (const MCExpr &)=delete
 
MCExproperator= (const MCExpr &)=delete
 
ExprKind getKind () const
 
SMLoc getLoc () const
 
void print (raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
 
void dump () const
 
bool evaluateAsAbsolute (int64_t &Res, const MCAssembler &Asm, const SectionAddrMap &Addrs) const
 Try to evaluate the expression to an absolute value.
 
bool evaluateAsAbsolute (int64_t &Res) const
 
bool evaluateAsAbsolute (int64_t &Res, const MCAssembler &Asm) const
 
bool evaluateAsAbsolute (int64_t &Res, const MCAssembler *Asm) const
 
bool evaluateKnownAbsolute (int64_t &Res, const MCAssembler &Asm) const
 Aggressive variant of evaluateAsRelocatable when relocations are unavailable (e.g.
 
bool evaluateAsRelocatable (MCValue &Res, const MCAssembler *Asm, const MCFixup *Fixup) const
 Try to evaluate the expression to a relocatable value, i.e.
 
bool evaluateAsValue (MCValue &Res, const MCAssembler &Asm) const
 Try to evaluate the expression to the form (a - b + constant) where neither a nor b are variables.
 
MCFragmentfindAssociatedFragment () const
 Find the "associated section" for this expression, which is currently defined as the absolute section for constants, or otherwise the section associated with the first defined symbol in the expression.
 

Static Public Member Functions

static bool classof (const MCExpr *E)
 
Construction
static const MCConstantExprcreate (int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
 

Additional Inherited Members

- Public Types inherited from llvm::MCExpr
enum  ExprKind : uint8_t {
  Binary , Constant , SymbolRef , Unary ,
  Target
}
 
- Protected Member Functions inherited from llvm::MCExpr
 MCExpr (ExprKind Kind, SMLoc Loc, unsigned SubclassData=0)
 
bool evaluateAsRelocatableImpl (MCValue &Res, const MCAssembler *Asm, const MCFixup *Fixup, const SectionAddrMap *Addrs, bool InSet) const
 
unsigned getSubclassData () const
 

Detailed Description

Definition at line 140 of file MCExpr.h.

Member Function Documentation

◆ classof()

static bool llvm::MCConstantExpr::classof ( const MCExpr E)
inlinestatic

Definition at line 178 of file MCExpr.h.

References llvm::MCExpr::Constant, and E.

◆ create()

const MCConstantExpr * MCConstantExpr::create ( int64_t  Value,
MCContext Ctx,
bool  PrintInHex = false,
unsigned  SizeInBytes = 0 
)
static

Definition at line 193 of file MCExpr.cpp.

Referenced by llvm::HexagonMCInstrInfo::addConstant(), adjustDuplex(), ARMEmitUnwindInfo(), llvm::AMDGPU::MCKernelDescriptor::bits_get(), llvm::AMDGPU::MCKernelDescriptor::bits_set(), llvm::AMDGPUMCExpr::createExtraSGPRs(), llvm::AMDGPUMCExpr::createOccupancy(), llvm::AMDGPUDisassembler::decodeVersionImm(), llvm::AMDGPUTargetELFStreamer::emitAMDGPULDS(), llvm::AMDGPUTargetAsmStreamer::EmitAmdhsaKernelDescriptor(), llvm::AMDGPUTargetELFStreamer::EmitAmdhsaKernelDescriptor(), llvm::MCWinCOFFStreamer::emitCOFFImgRel32(), llvm::MCWinCOFFStreamer::emitCOFFSecRel32(), llvm::MCELFStreamer::emitCommonSymbol(), llvm::WebAssemblyAsmPrinter::emitEndOfAsmFile(), llvm::CodeViewContext::emitFileChecksums(), llvm::MCStreamer::emitFill(), llvm::AsmPrinter::emitFrameAlloc(), llvm::AsmPrinter::emitGlobalAlias(), llvm::AsmPrinter::emitGlobalVariable(), llvm::ARMAsmPrinter::emitInstruction(), llvm::SystemZAsmPrinter::emitInstruction(), llvm::ARMAsmPrinter::emitJumpTableAddrs(), llvm::ARMAsmPrinter::emitJumpTableTBInst(), llvm::AMDGPU::AMDGPUMCKernelCodeT::EmitKernelCodeT(), llvm::AsmPrinter::emitLabelPlusOffset(), llvm::XtensaAsmPrinter::emitMachineConstantPoolEntry(), llvm::ARMAsmPrinter::emitMachineConstantPoolValue(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), llvm::AVRAsmPrinter::emitStartOfAsmFile(), llvm::X86AsmPrinter::emitStartOfAsmFile(), EmitSymbolRefWithOfs(), llvm::AsmPrinter::emitXRayTable(), llvm::CodeViewContext::encodeDefRange(), llvm::AMDGPUTargetELFStreamer::finish(), llvm::MipsMCCodeEmitter::getBranchTarget21OpValue(), llvm::MipsMCCodeEmitter::getBranchTarget21OpValueMM(), llvm::MipsMCCodeEmitter::getBranchTarget26OpValue(), llvm::MipsMCCodeEmitter::getBranchTarget26OpValueMM(), llvm::MipsMCCodeEmitter::getBranchTargetOpValue(), llvm::MipsMCCodeEmitter::getBranchTargetOpValue1SImm16(), llvm::MipsMCCodeEmitter::getBranchTargetOpValueLsl2MMR6(), llvm::MipsMCCodeEmitter::getBranchTargetOpValueMMR6(), llvm::SIProgramInfo::getComputePGMRSrc1(), llvm::SIProgramInfo::getComputePGMRSrc2(), llvm::MipsTargetObjectFile::getDebugThreadLocalSymbol(), llvm::AMDGPU::MCKernelDescriptor::getDefaultAmdhsaKernelDescriptor(), llvm::SystemZMCInstLower::getExpr(), llvm::X86_64MCAsmInfoDarwin::getExprForPersonalitySymbol(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::AArch64_ELFTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::ARMElfTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::RISCVELFTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::X86_64MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::X86_64ELFTargetObjectFile::getIndirectSymViaGOTPCRel(), llvm::SIProgramInfo::getPGMRSrc1(), llvm::SIProgramInfo::getPGMRSrc2(), GetSubDivExpr(), GetSymbolRef(), llvm::X86_64MachoTargetObjectFile::getTTypeGlobalReference(), llvm::HexagonLowerToMC(), llvm::HexagonMCELFStreamer::HexagonMCEmitCommonSymbol(), llvm::HexagonAsmPrinter::HexagonProcessInstruction(), llvm::AMDGPU::AMDGPUMCKernelCodeT::initDefault(), llvm::SIInstrInfo::insertIndirectBranch(), llvm::AsmPrinter::lowerConstant(), AMDGPUMCInstLower::lowerOperand(), LowerSymbolOperand(), llvm::XtensaAsmPrinter::LowerSymbolOperand(), llvm::LanaiMCInstLower::LowerSymbolOperand(), llvm::M68kMCInstLower::LowerSymbolOperand(), llvm::MSP430MCInstLower::LowerSymbolOperand(), lowerSymbolOperand(), llvm::AVRMCInstLower::lowerSymbolOperand(), llvm::AArch64MCInstLower::lowerSymbolOperandCOFF(), llvm::AArch64MCInstLower::lowerSymbolOperandELF(), llvm::AArch64MCInstLower::lowerSymbolOperandMachO(), makeEndMinusStartExpr(), makeStartPlusIntExpr(), MaskShift(), llvm::AMDGPU::maskShiftGet(), llvm::AMDGPU::maskShiftSet(), llvm::SIProgramInfo::reset(), llvm::AMDGPUAsmPrinter::runOnMachineFunction(), ScaleVectorOffset(), llvm::AMDGPUPALMetadata::setRegister(), llvm::MCContext::setSymbolValue(), llvm::LoongArchAsmBackend::shouldInsertFixupForCodeAlign(), llvm::RISCVAsmBackend::shouldInsertFixupForCodeAlign(), llvm::MCExternalSymbolizer::tryAddingSymbolicOperand(), llvm::AArch64ExternalSymbolizer::tryAddingSymbolicOperand(), and tryFoldHelper().

◆ getSizeInBytes()

unsigned llvm::MCConstantExpr::getSizeInBytes ( ) const
inline

Definition at line 170 of file MCExpr.h.

References llvm::MCExpr::getSubclassData().

◆ getValue()

int64_t llvm::MCConstantExpr::getValue ( ) const
inline

Definition at line 169 of file MCExpr.h.

Referenced by IsMemoryAssignmentError(), and shouldBeSls().

◆ useHexFormat()

bool llvm::MCConstantExpr::useHexFormat ( ) const
inline

Definition at line 174 of file MCExpr.h.

References llvm::MCExpr::getSubclassData().


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