LLVM 23.0.0git
PPCMCAsmInfo.h
Go to the documentation of this file.
1//===-- PPCMCAsmInfo.h - PPC asm properties --------------------*- C++ -*--===//
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 PowerPC MCAsmInfo classes.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_POWERPC_MCTARGETDESC_PPCMCASMINFO_H
14#define LLVM_LIB_TARGET_POWERPC_MCTARGETDESC_PPCMCASMINFO_H
15
18#include "llvm/MC/MCExpr.h"
19#include "llvm/MC/MCValue.h"
20
21namespace llvm {
22class Triple;
23
25 void anchor() override;
26
27public:
28 explicit PPCELFMCAsmInfo(bool is64Bit, const Triple &,
31 const MCSpecifierExpr &Expr) const override;
33 const MCAssembler *Asm) const override;
34};
35
37public:
38 explicit PPCXCOFFMCAsmInfo(bool is64Bit, const Triple &,
41 const MCSpecifierExpr &Expr) const override;
43 const MCAssembler *Asm) const override;
44};
45
46namespace PPC {
49
59
60 S_AIX_TLSGD, // symbol@gd
61 S_AIX_TLSGDM, // symbol@m
62 S_AIX_TLSIE, // symbol@ie
63 S_AIX_TLSLD, // symbol@ld
64 S_AIX_TLSLE, // symbol@le
65 S_AIX_TLSML, // symbol@ml
66 S_DTPMOD, // symbol@dtpmod
67 S_DTPREL, // symbol@dprel
68 S_DTPREL_HA, // symbol@dtprel@ha
69 S_DTPREL_HI, // symbol@dtprel@h
70 S_DTPREL_HIGH, // symbol@dtprel@high
71 S_DTPREL_HIGHA, // symbol@dtprel@higha
72 S_DTPREL_HIGHER, // symbol@dtprel@higher
73 S_DTPREL_HIGHERA, // symbol@dtprel@highera
74 S_DTPREL_HIGHEST, // symbol@dtprel@highest
75 S_DTPREL_HIGHESTA, // symbol@dtprel@highesta
76 S_DTPREL_LO, // symbol@dtprel@l
77 S_GOT, // symbol@got
78 S_GOT_DTPREL, // symbol@got@dtprel
79 S_GOT_DTPREL_HA, // symbol@got@dtprel@ha
80 S_GOT_DTPREL_HI, // symbol@got@dtprel@h
81 S_GOT_DTPREL_LO, // symbol@got@dtprel@l
82 S_GOT_HA, // symbol@got@ha
83 S_GOT_HI, // symbol@got@h
84 S_GOT_LO, // symbol@got@l
85 S_GOT_PCREL, // symbol@got@pcrel
86 S_GOT_TLSGD, // symbol@got@tlsgd
87 S_GOT_TLSGD_HA, // symbol@got@tlsgd@ha
88 S_GOT_TLSGD_HI, // symbol@got@tlsgd@h
89 S_GOT_TLSGD_LO, // symbol@got@tlsgd@l
90 S_GOT_TLSGD_PCREL, // symbol@got@tlsgd@pcrel
91 S_GOT_TLSLD, // symbol@got@tlsld
92 S_GOT_TLSLD_HA, // symbol@got@tlsld@ha
93 S_GOT_TLSLD_HI, // symbol@got@tlsld@h
94 S_GOT_TLSLD_LO, // symbol@got@tlsld@l
95 S_GOT_TLSLD_PCREL, // symbol@got@tlsld@pcrel
96 S_GOT_TPREL, // symbol@got@tprel
97 S_GOT_TPREL_HA, // symbol@got@tprel@ha
98 S_GOT_TPREL_HI, // symbol@got@tprel@h
99 S_GOT_TPREL_LO, // symbol@got@tprel@l
100 S_GOT_TPREL_PCREL, // symbol@got@tprel@pcrel
101 S_L, // symbol@l
102 S_LOCAL, // symbol@local
103 S_NOTOC, // symbol@notoc
105 S_PCREL_OPT, // .reloc expr, R_PPC64_PCREL_OPT, expr
106 S_PLT, // symbol@plt
107 S_TLS, // symbol@tls
108 S_TLSGD, // symbol@tlsgd
109 S_TLSLD, // symbol@tlsld
110 S_TLS_PCREL, // symbol@tls@pcrel
111 S_TOC, // symbol@toc
112 S_TOCBASE, // symbol@tocbase
113 S_TOC_HA, // symbol@toc@ha
114 S_TOC_HI, // symbol@toc@h
115 S_TOC_LO, // symbol@toc@l
116 S_TPREL, // symbol@tprel
117 S_TPREL_HA, // symbol@tprel@ha
118 S_TPREL_HI, // symbol@tprel@h
119 S_TPREL_HIGH, // symbol@tprel@high
120 S_TPREL_HIGHA, // symbol@tprel@higha
121 S_TPREL_HIGHER, // symbol@tprel@higher
122 S_TPREL_HIGHERA, // symbol@tprel@highera
123 S_TPREL_HIGHEST, // symbol@tprel@highest
124 S_TPREL_HIGHESTA, // symbol@tprel@highesta
125 S_TPREL_LO, // symbol@tprel@l
126 S_U, // symbol@u
127};
128
129bool evaluateAsConstant(const MCSpecifierExpr &Expr, int64_t &Res);
130}
131
132namespace PPCMCExpr {
134}
135
136static inline uint16_t getSpecifier(const MCSymbolRefExpr *SRE) {
137 return SRE->getKind();
138}
139} // namespace llvm
140
141#endif
static LVOptions Options
Definition LVOptions.cpp:25
static bool is64Bit(const char *name)
MCAsmInfoELF(const MCTargetOptions &Options)
MCAsmInfoXCOFF(const MCTargetOptions &Options)
Extension point for target-specific MCExpr subclasses with a relocation specifier,...
Definition MCExpr.h:495
Represent a reference to a symbol from inside an expression.
Definition MCExpr.h:190
VariantKind getKind() const
Definition MCExpr.h:232
bool evaluateAsRelocatableImpl(const MCSpecifierExpr &Expr, MCValue &Res, const MCAssembler *Asm) const override
PPCELFMCAsmInfo(bool is64Bit, const Triple &, const MCTargetOptions &Options)
void printSpecifierExpr(raw_ostream &OS, const MCSpecifierExpr &Expr) const override
bool evaluateAsRelocatableImpl(const MCSpecifierExpr &Expr, MCValue &Res, const MCAssembler *Asm) const override
void printSpecifierExpr(raw_ostream &OS, const MCSpecifierExpr &Expr) const override
PPCXCOFFMCAsmInfo(bool is64Bit, const Triple &, const MCTargetOptions &Options)
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 some predicates that are used for node matching.
bool evaluateAsConstant(const MCSpecifierExpr &Expr, int64_t &Res)
@ S_GOT_TLSGD_PCREL
@ S_GOT_TLSLD_PCREL
@ S_DTPREL_HIGHESTA
This is an optimization pass for GlobalISel generic memory operations.
static uint16_t getSpecifier(const MCSymbolRefExpr *SRE)