20AMDGPUVariadicMCExpr::AMDGPUVariadicMCExpr(VariadicKind Kind,
24 assert(
Args.size() >= 1 &&
"Needs a minimum of one expression.");
25 assert(Kind != AGVK_None &&
26 "Cannot construct AMDGPUVariadicMCExpr of kind none.");
33 RawArgs =
static_cast<const MCExpr **
>(
35 std::uninitialized_copy(
Args.begin(),
Args.end(), RawArgs);
39AMDGPUVariadicMCExpr::~AMDGPUVariadicMCExpr() { Ctx.
deallocate(RawArgs); }
49 "Indexing out of bounds AMDGPUVariadicMCExpr sub-expr");
65 for (
auto It = Args.begin(); It != Args.end(); ++It) {
66 (*It)->print(
OS, MAI,
false);
67 if ((It + 1) != Args.end())
79 return std::max(Arg1, Arg2);
87 std::optional<int64_t>
Total;
89 for (
const MCExpr *Arg : Args) {
91 if (!Arg->evaluateAsRelocatable(ArgRes, Layout,
Fixup) ||
95 if (!
Total.has_value())
105 for (
const MCExpr *Arg : Args)
110 for (
const MCExpr *Arg : Args) {
111 if (Arg->findAssociatedFragment())
112 return Arg->findAssociatedFragment();
This file defines the BumpPtrAllocator interface.
PowerPC TLS Dynamic Call Fixup
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
AMDGPU target specific variadic MCExpr operations.
static const AMDGPUVariadicMCExpr * create(VariadicKind Kind, ArrayRef< const MCExpr * > Args, MCContext &Ctx)
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const override
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override
MCFragment * findAssociatedFragment() const override
const MCExpr * getSubExpr(size_t Index) const
void visitUsedExpr(MCStreamer &Streamer) const override
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This class is intended to be used as a base class for asm properties and features specific to the tar...
Encapsulates the layout of an assembly file at a particular point in time.
Context object for machine code objects.
void * allocate(unsigned Size, unsigned Align=8)
void deallocate(void *Ptr)
Base class for the full range of assembler expressions which are needed for parsing.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Streaming machine code generation interface.
void visitUsedExpr(const MCExpr &Expr)
This represents an "assembler immediate".
int64_t getConstant() const
static MCValue get(const MCSymbolRefExpr *SymA, const MCSymbolRefExpr *SymB=nullptr, int64_t Val=0, uint32_t RefKind=0)
bool isAbsolute() const
Is this an absolute (as opposed to relocatable) value.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
This is an optimization pass for GlobalISel generic memory operations.