LLVM  12.0.0git
Go to the documentation of this file.
1 //===-- RISCVMCAsmInfo.cpp - RISCV 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 //===----------------------------------------------------------------------===//
13 #include "RISCVMCAsmInfo.h"
15 #include "llvm/ADT/Triple.h"
17 #include "llvm/MC/MCStreamer.h"
18 using namespace llvm;
20 void RISCVMCAsmInfo::anchor() {}
24  CommentString = "#";
25  AlignmentIsInBytes = false;
28  Data16bitsDirective = "\t.half\t";
29  Data32bitsDirective = "\t.word\t";
30 }
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");
47 }
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:384
This class represents lattice values for constants.
Definition: AllocatorList.h:23
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
const MCExpr * getExprForFDESymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const override
unsigned CalleeSaveStackSlotSize
Size of the stack slot reserved for callee-saved registers, in bytes.
Definition: MCAsmInfo.h:67
bool AlignmentIsInBytes
If this is true (the default) then the asmprinter emits ".align N" directives, where N is the number ...
Definition: MCAsmInfo.h:248
MCContext & getContext() const
Definition: MCStreamer.h:265
StringRef CommentString
This indicates the comment character used by the assembler.
Definition: MCAsmInfo.h:118
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
RISCVMCAsmInfo(const Triple &TargetTriple)
Context object for machine code objects.
Definition: MCContext.h:67
Streaming machine code generation interface.
Definition: MCStreamer.h:196
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:350
const char * Data16bitsDirective
Definition: MCAsmInfo.h:208
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
const char * Data32bitsDirective
Definition: MCAsmInfo.h:209
This file contains constants used for implementing Dwarf debug support.
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
Definition: MCAsmInfo.h:63
bool isArch64Bit() const
Test whether the architecture is 64-bit.
Definition: Triple.cpp:1303
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition: MCAsmInfo.h:353
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
DWARF-like instruction based exceptions.
static const RISCVMCExpr * create(const MCExpr *Expr, VariantKind Kind, MCContext &Ctx)
Definition: RISCVMCExpr.cpp:31
virtual const MCExpr * getExprForFDESymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const
Definition: MCAsmInfo.cpp:89