LLVM 24.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"
15#include "llvm/ADT/Enum.h"
17#include "llvm/MC/MCExpr.h"
18#include "llvm/MC/MCStreamer.h"
19
20using namespace llvm;
21
23 {{"GOT"}, CSKY::S_GOT}, {{"GOTOFF"}, CSKY::S_GOTOFF},
24 {{"PLT"}, CSKY::S_PLT}, {{"TLSGD"}, CSKY::S_TLSGD},
25 {{"TLSLDM"}, CSKY::S_TLSLDM}, {{"TPOFF"}, CSKY::S_TPOFF},
26};
28
29void CSKYMCAsmInfo::anchor() {}
30
34 AlignmentIsInBytes = false;
36 CommentString = "#";
37
38 // Uses '.section' before '.bss' directive
40
42
44}
45
47 using namespace CSKY;
48 switch (Kind) {
49 default:
50 llvm_unreachable("Invalid ELF symbol kind");
51 case S_None:
52 case S_ADDR:
53 return "";
54 case S_ADDR_HI16:
55 return "@HI16";
56 case S_ADDR_LO16:
57 return "@LO16";
58 case S_GOT_IMM18_BY4:
59 case S_GOT:
60 return "@GOT";
61 case S_GOTPC:
62 return "@GOTPC";
63 case S_GOTOFF:
64 return "@GOTOFF";
65 case S_PLT_IMM18_BY4:
66 case S_PLT:
67 return "@PLT";
68 case S_TLSLE:
69 return "@TPOFF";
70 case S_TLSIE:
71 return "@GOTTPOFF";
72 case S_TLSGD:
73 return "@TLSGD32";
74 case S_TLSLDO:
75 return "@TLSLDO32";
76 case S_TLSLDM:
77 return "@TLSLDM32";
78 }
79}
80
82 const MCSpecifierExpr &Expr) const {
83 printExpr(OS, *Expr.getSubExpr());
84 OS << getVariantKindName(Expr.getSpecifier());
85}
constexpr EnumStringDef< MCAsmInfo::AtSpecifierKind > AtSpecifierDefs[]
constexpr auto atSpecifiers
static StringRef getVariantKindName(uint8_t Kind)
This file contains constants used for implementing Dwarf debug support.
#define BUILD_ENUM_STRINGS(Tab)
Definition Enum.h:120
static LVOptions Options
Definition LVOptions.cpp:25
void printSpecifierExpr(raw_ostream &OS, const MCSpecifierExpr &Expr) const override
CSKYMCAsmInfo(const Triple &TargetTriple, const MCTargetOptions &Options)
MCAsmInfoELF(const MCTargetOptions &Options)
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition MCAsmInfo.h:357
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:258
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition MCAsmInfo.h:354
bool AlignmentIsInBytes
If this is true (the default) then the asmprinter emits ".align N" directives, where N is the number ...
Definition MCAsmInfo.h:268
void initializeAtSpecifiers(EnumStrings< AtSpecifierKind, 1 >)
StringRef CommentString
This indicates the comment string used by the assembler.
Definition MCAsmInfo.h:134
Extension point for target-specific MCExpr subclasses with a relocation specifier,...
Definition MCExpr.h:494
const MCExpr * getSubExpr() const
Definition MCExpr.h:508
Spec getSpecifier() const
Definition MCExpr.h:507
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
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
Compile-time data representation of enum entries.
Definition Enum.h:47