LLVM 24.0.0git
PISAMCExpr.cpp
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file implements PISA-specific MC expressions.
11///
12//===----------------------------------------------------------------------===//
13
14#include "PISAMCExpr.h"
15#include "PISAInstPrinter.h"
16#include "llvm/MC/MCAssembler.h"
17#include "llvm/MC/MCContext.h"
18#include "llvm/Support/Format.h"
19using namespace llvm;
20
23 return new (Ctx) PISAGlobalAddressMCExpr(Symbol);
24}
25
26PISAGlobalAddressMCExpr::PISAGlobalAddressMCExpr(const MCSymbol &Sym)
27 : Symbol(&Sym) {
28 assert(Symbol);
29}
30
32 const MCAsmInfo *MAI) const {
33 OS << '@';
34 PISAInstPrinter::printSymbolName(OS, Symbol->getName(), MAI);
35}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file declares the PISA MCInst printer.
This file declares PISA-specific MC expressions for floating-point immediates.
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition MCAsmInfo.h:69
Context object for machine code objects.
Definition MCContext.h:84
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition MCSymbol.h:42
MCExpr for Global Address.
Definition PISAMCExpr.h:30
static const PISAGlobalAddressMCExpr * create(const MCSymbol &Symbol, MCContext &Ctx)
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override
static void printSymbolName(raw_ostream &OS, StringRef Name, const MCAsmInfo *MAI)
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.