Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
CSKYMCAsmInfo.cpp
Go to the documentation of this file.
1//===-- CSKYMCAsmInfo.cpp - CSKY 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 CSKYMCAsmInfo properties.
10//
11//===----------------------------------------------------------------------===//
12
13#include "CSKYMCAsmInfo.h"
16#include "llvm/MC/MCExpr.h"
17#include "llvm/MC/MCStreamer.h"
18
19using namespace llvm;
20
22 {CSKY::S_GOT, "GOT"}, {CSKY::S_GOTOFF, "GOTOFF"},
23 {CSKY::S_PLT, "PLT"}, {CSKY::S_TLSGD, "TLSGD"},
24 {CSKY::S_TLSLDM, "TLSLDM"}, {CSKY::S_TPOFF, "TPOFF"},
25};
26
27void CSKYMCAsmInfo::anchor() {}
28
30 AlignmentIsInBytes = false;
32 CommentString = "#";
33
34 // Uses '.section' before '.bss' directive
36
38
40}
41
43 using namespace CSKY;
44 switch (Kind) {
45 default:
46 llvm_unreachable("Invalid ELF symbol kind");
47 case S_None:
48 case S_ADDR:
49 return "";
50 case S_ADDR_HI16:
51 return "@HI16";
52 case S_ADDR_LO16:
53 return "@LO16";
54 case S_GOT_IMM18_BY4:
55 case S_GOT:
56 return "@GOT";
57 case S_GOTPC:
58 return "@GOTPC";
59 case S_GOTOFF:
60 return "@GOTOFF";
61 case S_PLT_IMM18_BY4:
62 case S_PLT:
63 return "@PLT";
64 case S_TLSLE:
65 return "@TPOFF";
66 case S_TLSIE:
67 return "@GOTTPOFF";
68 case S_TLSGD:
69 return "@TLSGD32";
70 case S_TLSLDO:
71 return "@TLSLDO32";
72 case S_TLSLDM:
73 return "@TLSLDM32";
74 }
75}
76
78 const MCSpecifierExpr &Expr) const {
79 printExpr(OS, *Expr.getSubExpr());
80 OS << getVariantKindName(Expr.getSpecifier());
81}
const MCAsmInfo::AtSpecifier atSpecifiers[]
static StringRef getVariantKindName(uint8_t Kind)
This file contains constants used for implementing Dwarf debug support.
void printSpecifierExpr(raw_ostream &OS, const MCSpecifierExpr &Expr) const override
CSKYMCAsmInfo(const Triple &TargetTriple)
void initializeAtSpecifiers(ArrayRef< AtSpecifier >)
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition MCAsmInfo.h:359
void printExpr(raw_ostream &, const MCExpr &) const
bool UsesELFSectionDirectiveForBSS
This is true if this target uses ELF '.section' directive before the '.bss' one.
Definition MCAsmInfo.h:263
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition MCAsmInfo.h:356
bool AlignmentIsInBytes
If this is true (the default) then the asmprinter emits ".align N" directives, where N is the number ...
Definition MCAsmInfo.h:273
StringRef CommentString
This indicates the comment string used by the assembler.
Definition MCAsmInfo.h:135
Extension point for target-specific MCExpr subclasses with a relocation specifier,...
Definition MCExpr.h:495
const MCExpr * getSubExpr() const
Definition MCExpr.h:509
Spec getSpecifier() const
Definition MCExpr.h:508
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:47
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
@ DwarfCFI
DWARF-like instruction based exceptions.
Definition CodeGen.h:55