LLVM 19.0.0git
RISCVMCAsmInfo.cpp
Go to the documentation of this file.
1//===-- RISCVMCAsmInfo.cpp - RISC-V Asm properties ------------------------===//
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// This file contains the declarations of the RISCVMCAsmInfo properties.
10//
11//===----------------------------------------------------------------------===//
12
13#include "RISCVMCAsmInfo.h"
16#include "llvm/MC/MCStreamer.h"
18using namespace llvm;
19
20void RISCVMCAsmInfo::anchor() {}
21
23 CodePointerSize = CalleeSaveStackSlotSize = TT.isArch64Bit() ? 8 : 4;
24 CommentString = "#";
25 AlignmentIsInBytes = false;
28 Data16bitsDirective = "\t.half\t";
29 Data32bitsDirective = "\t.word\t";
30}
31
33 unsigned Encoding,
34 MCStreamer &Streamer) const {
35 if (!(Encoding & dwarf::DW_EH_PE_pcrel))
36 return MCAsmInfo::getExprForFDESymbol(Sym, Encoding, Streamer);
37
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");
47}
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:91
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:76
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
Streaming machine code generation interface.
Definition: MCStreamer.h:212
MCContext & getContext() const
Definition: MCStreamer.h:297
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:397
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:40
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:31
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
@ DW_EH_PE_pcrel
Definition: Dwarf.h:534
@ DW_EH_PE_sdata4
Definition: Dwarf.h:531
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ DwarfCFI
DWARF-like instruction based exceptions.