LLVM 24.0.0git
SparcMCAsmInfo.cpp
Go to the documentation of this file.
1//===- SparcMCAsmInfo.cpp - Sparc 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 SparcMCAsmInfo properties.
10//
11//===----------------------------------------------------------------------===//
12
13#include "SparcMCAsmInfo.h"
16#include "llvm/MC/MCExpr.h"
17#include "llvm/MC/MCStreamer.h"
20
21using namespace llvm;
22
25 : MCAsmInfoELF(TheTriple, Options) {
26 bool isV9 = TheTriple.isSPARC64();
27 IsLittleEndian = (TheTriple.getArch() == Triple::sparcel);
28
29 if (isV9) {
31 }
32
33 Data16bitsDirective = "\t.half\t";
34 Data32bitsDirective = "\t.word\t";
35 // .xword is only supported by V9.
36 Data64bitsDirective = (isV9) ? "\t.xword\t" : nullptr;
37 ZeroDirective = "\t.skip\t";
38 CommentString = "!";
40
41 DwarfFDERelSymbolSpec = ELF::R_SPARC_DISP32;
42
43 SpecifierExprPrintFn = [](const MCAsmInfo &MAI, raw_ostream &OS,
44 const MCSpecifierExpr &Expr) {
45 StringRef S = Sparc::getSpecifierName(Expr.getSpecifier());
46 if (!S.empty())
47 OS << '%' << S << '(';
48 MAI.printExpr(OS, *Expr.getSubExpr());
49 if (!S.empty())
50 OS << ')';
51 };
52}
This file contains constants used for implementing Dwarf debug support.
static LVOptions Options
Definition LVOptions.cpp:25
MCAsmInfoELF(const Triple &TT, const MCTargetOptions &Options)
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition MCAsmInfo.h:69
const char * Data16bitsDirective
Definition MCAsmInfo.h:262
const char * Data64bitsDirective
Definition MCAsmInfo.h:264
const char * Data32bitsDirective
Definition MCAsmInfo.h:263
void printExpr(raw_ostream &, const MCExpr &) const
uint16_t DwarfFDERelSymbolSpec
The optional specifier to use for the relative FDE symbol references.
Definition MCAsmInfo.h:400
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition MCAsmInfo.h:372
void(* SpecifierExprPrintFn)(const MCAsmInfo &, raw_ostream &, const MCSpecifierExpr &)
Definition MCAsmInfo.h:228
const char * ZeroDirective
This should be set to the directive used to get some number of zero (and non-zero if supported by the...
Definition MCAsmInfo.h:240
bool IsLittleEndian
True if target is little endian. Default is true.
Definition MCAsmInfo.h:95
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
Definition MCAsmInfo.h:88
unsigned CalleeSaveStackSlotSize
Size of the stack slot reserved for callee-saved registers, in bytes.
Definition MCAsmInfo.h:92
StringRef CommentString
This indicates the comment string used by the assembler.
Definition MCAsmInfo.h:144
Extension point for target-specific MCExpr subclasses with a relocation specifier,...
Definition MCExpr.h:491
SparcELFMCAsmInfo(const Triple &TheTriple, const MCTargetOptions &Options)
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
constexpr bool empty() const
Check if the string is empty.
Definition StringRef.h:141
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
ArchType getArch() const
Get the parsed architecture type of this triple.
Definition Triple.h:518
bool isSPARC64() const
Tests whether the target is 64-bit SPARC (big endian).
Definition Triple.h:1198
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
StringRef getSpecifierName(uint16_t S)
This is an optimization pass for GlobalISel generic memory operations.