LLVM 19.0.0git
Go to the documentation of this file.
1//===-- RISCVMCAsmInfo.cpp - RISC-V Asm properties ------------------------===//
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
9// This file contains the declarations of the RISCVMCAsmInfo properties.
13#include "RISCVMCAsmInfo.h"
16#include "llvm/MC/MCStreamer.h"
18using namespace llvm;
20void RISCVMCAsmInfo::anchor() {}
23 CodePointerSize = CalleeSaveStackSlotSize = TT.isArch64Bit() ? 8 : 4;
24 CommentString = "#";
25 AlignmentIsInBytes = false;
28 Data16bitsDirective = "\t.half\t";
29 Data32bitsDirective = "\t.word\t";
33 unsigned Encoding,
34 MCStreamer &Streamer) const {
35 if (!(Encoding & dwarf::DW_EH_PE_pcrel))
36 return MCAsmInfo::getExprForFDESymbol(Sym, Encoding, Streamer);
38 // The default symbol subtraction results in an ADD/SUB relocation pair.
39 // Processing this relocation pair is problematic when linker relaxation is
40 // enabled, so we follow binutils in using the R_RISCV_32_PCREL relocation
41 // for the FDE initial location.
42 MCContext &Ctx = Streamer.getContext();
43 const MCExpr *ME =
45 assert(Encoding & dwarf::DW_EH_PE_sdata4 && "Unexpected encoding");
This file contains constants used for implementing Dwarf debug support.
Symbol * Sym
Definition: ELF_riscv.cpp:479
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const char * Data16bitsDirective
Definition: MCAsmInfo.h:289
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition: MCAsmInfo.h:457
const char * Data32bitsDirective
Definition: MCAsmInfo.h:290
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:454
virtual const MCExpr * getExprForFDESymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const
Definition: MCAsmInfo.cpp:87
bool AlignmentIsInBytes
If this is true (the default) then the asmprinter emits ".align N" directives, where N is the number ...
Definition: MCAsmInfo.h:332
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
Definition: MCAsmInfo.h:72
unsigned CalleeSaveStackSlotSize
Size of the stack slot reserved for callee-saved registers, in bytes.
Definition: MCAsmInfo.h:76
StringRef CommentString
This indicates the comment string used by the assembler.
Definition: MCAsmInfo.h:135
Context object for machine code objects.
Definition: MCContext.h:83
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:34
Streaming machine code generation interface.
Definition: MCStreamer.h:213
MCContext & getContext() const
Definition: MCStreamer.h:300
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:393
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
RISCVMCAsmInfo(const Triple &TargetTriple)
const MCExpr * getExprForFDESymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const override
static const RISCVMCExpr * create(const MCExpr *Expr, VariantKind Kind, MCContext &Ctx)
Definition: RISCVMCExpr.cpp:30
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
@ DW_EH_PE_pcrel
Definition: Dwarf.h:851
@ DW_EH_PE_sdata4
Definition: Dwarf.h:848
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ DwarfCFI
DWARF-like instruction based exceptions.