LLVM  14.0.0git
PPCMCTargetDesc.cpp
Go to the documentation of this file.
1 //===-- PPCMCTargetDesc.cpp - PowerPC Target Descriptions -----------------===//
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 provides PowerPC specific target descriptions.
10 //
11 //===----------------------------------------------------------------------===//
12 
16 #include "PPCELFStreamer.h"
17 #include "PPCTargetStreamer.h"
18 #include "PPCXCOFFStreamer.h"
20 #include "llvm/ADT/SmallPtrSet.h"
21 #include "llvm/ADT/StringRef.h"
22 #include "llvm/ADT/Triple.h"
23 #include "llvm/BinaryFormat/ELF.h"
24 #include "llvm/MC/MCAsmBackend.h"
25 #include "llvm/MC/MCAssembler.h"
26 #include "llvm/MC/MCCodeEmitter.h"
27 #include "llvm/MC/MCContext.h"
28 #include "llvm/MC/MCDwarf.h"
29 #include "llvm/MC/MCELFStreamer.h"
30 #include "llvm/MC/MCExpr.h"
31 #include "llvm/MC/MCInstrInfo.h"
32 #include "llvm/MC/MCObjectWriter.h"
33 #include "llvm/MC/MCRegisterInfo.h"
34 #include "llvm/MC/MCSectionXCOFF.h"
35 #include "llvm/MC/MCStreamer.h"
37 #include "llvm/MC/MCSymbol.h"
38 #include "llvm/MC/MCSymbolELF.h"
39 #include "llvm/MC/MCSymbolXCOFF.h"
40 #include "llvm/MC/TargetRegistry.h"
41 #include "llvm/Support/Casting.h"
42 #include "llvm/Support/CodeGen.h"
46 
47 using namespace llvm;
48 
49 #define GET_INSTRINFO_MC_DESC
50 #include "PPCGenInstrInfo.inc"
51 
52 #define GET_SUBTARGETINFO_MC_DESC
53 #include "PPCGenSubtargetInfo.inc"
54 
55 #define GET_REGINFO_MC_DESC
56 #include "PPCGenRegisterInfo.inc"
57 
59 
60 // Pin the vtable to this file.
62 
64  MCInstrInfo *X = new MCInstrInfo();
65  InitPPCMCInstrInfo(X);
66  return X;
67 }
68 
70  bool isPPC64 =
71  (TT.getArch() == Triple::ppc64 || TT.getArch() == Triple::ppc64le);
72  unsigned Flavour = isPPC64 ? 0 : 1;
73  unsigned RA = isPPC64 ? PPC::LR8 : PPC::LR;
74 
76  InitPPCMCRegisterInfo(X, RA, Flavour, Flavour);
77  return X;
78 }
79 
81  StringRef CPU, StringRef FS) {
82  // Set some default feature to MC layer.
83  std::string FullFS = std::string(FS);
84 
85  if (TT.isOSAIX()) {
86  if (!FullFS.empty())
87  FullFS = "+aix," + FullFS;
88  else
89  FullFS = "+aix";
90  }
91 
92  return createPPCMCSubtargetInfoImpl(TT, CPU, /*TuneCPU*/ CPU, FullFS);
93 }
94 
96  const Triple &TheTriple,
97  const MCTargetOptions &Options) {
98  bool isPPC64 = (TheTriple.getArch() == Triple::ppc64 ||
99  TheTriple.getArch() == Triple::ppc64le);
100 
101  MCAsmInfo *MAI;
102  if (TheTriple.isOSBinFormatXCOFF())
103  MAI = new PPCXCOFFMCAsmInfo(isPPC64, TheTriple);
104  else
105  MAI = new PPCELFMCAsmInfo(isPPC64, TheTriple);
106 
107  // Initial state of the frame pointer is R1.
108  unsigned Reg = isPPC64 ? PPC::X1 : PPC::R1;
109  MCCFIInstruction Inst =
110  MCCFIInstruction::cfiDefCfa(nullptr, MRI.getDwarfRegNum(Reg, true), 0);
111  MAI->addInitialFrameState(Inst);
112 
113  return MAI;
114 }
115 
116 static MCStreamer *
118  std::unique_ptr<MCAsmBackend> &&MAB,
119  std::unique_ptr<MCObjectWriter> &&OW,
120  std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll) {
122  std::move(Emitter));
123 }
124 
126  const Triple &T, MCContext &Context, std::unique_ptr<MCAsmBackend> &&MAB,
127  std::unique_ptr<MCObjectWriter> &&OW,
128  std::unique_ptr<MCCodeEmitter> &&Emitter, bool RelaxAll) {
130  std::move(Emitter));
131 }
132 
133 namespace {
134 
135 class PPCTargetAsmStreamer : public PPCTargetStreamer {
137 
138 public:
139  PPCTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS)
140  : PPCTargetStreamer(S), OS(OS) {}
141 
142  void emitTCEntry(const MCSymbol &S,
144  if (const MCSymbolXCOFF *XSym = dyn_cast<MCSymbolXCOFF>(&S)) {
145  MCSymbolXCOFF *TCSym =
146  cast<MCSectionXCOFF>(Streamer.getCurrentSectionOnly())
147  ->getQualNameSymbol();
148  // If the variant kind is VK_PPC_AIX_TLSGDM the entry represents the
149  // region handle for the symbol, we add the relocation specifier @m.
150  // If the variant kind is VK_PPC_AIX_TLSGD the entry represents the
151  // variable offset for the symbol, we add the relocation specifier @gd.
152  if (Kind == MCSymbolRefExpr::VariantKind::VK_PPC_AIX_TLSGD ||
153  Kind == MCSymbolRefExpr::VariantKind::VK_PPC_AIX_TLSGDM)
154  OS << "\t.tc " << TCSym->getName() << "," << XSym->getName() << "@"
156  else
157  OS << "\t.tc " << TCSym->getName() << "," << XSym->getName() << '\n';
158 
159  if (TCSym->hasRename())
160  Streamer.emitXCOFFRenameDirective(TCSym, TCSym->getSymbolTableName());
161  return;
162  }
163 
164  OS << "\t.tc " << S.getName() << "[TC]," << S.getName() << '\n';
165  }
166 
167  void emitMachine(StringRef CPU) override {
168  OS << "\t.machine " << CPU << '\n';
169  }
170 
171  void emitAbiVersion(int AbiVersion) override {
172  OS << "\t.abiversion " << AbiVersion << '\n';
173  }
174 
175  void emitLocalEntry(MCSymbolELF *S, const MCExpr *LocalOffset) override {
176  const MCAsmInfo *MAI = Streamer.getContext().getAsmInfo();
177 
178  OS << "\t.localentry\t";
179  S->print(OS, MAI);
180  OS << ", ";
181  LocalOffset->print(OS, MAI);
182  OS << '\n';
183  }
184 };
185 
186 class PPCTargetELFStreamer : public PPCTargetStreamer {
187 public:
188  PPCTargetELFStreamer(MCStreamer &S) : PPCTargetStreamer(S) {}
189 
190  MCELFStreamer &getStreamer() {
191  return static_cast<MCELFStreamer &>(Streamer);
192  }
193 
194  void emitTCEntry(const MCSymbol &S,
196  // Creates a R_PPC64_TOC relocation
197  Streamer.emitValueToAlignment(8);
198  Streamer.emitSymbolValue(&S, 8);
199  }
200 
201  void emitMachine(StringRef CPU) override {
202  // FIXME: Is there anything to do in here or does this directive only
203  // limit the parser?
204  }
205 
206  void emitAbiVersion(int AbiVersion) override {
207  MCAssembler &MCA = getStreamer().getAssembler();
208  unsigned Flags = MCA.getELFHeaderEFlags();
209  Flags &= ~ELF::EF_PPC64_ABI;
210  Flags |= (AbiVersion & ELF::EF_PPC64_ABI);
211  MCA.setELFHeaderEFlags(Flags);
212  }
213 
214  void emitLocalEntry(MCSymbolELF *S, const MCExpr *LocalOffset) override {
215  MCAssembler &MCA = getStreamer().getAssembler();
216 
217  // encodePPC64LocalEntryOffset will report an error if it cannot
218  // encode LocalOffset.
219  unsigned Encoded = encodePPC64LocalEntryOffset(LocalOffset);
220 
221  unsigned Other = S->getOther();
223  Other |= Encoded;
224  S->setOther(Other);
225 
226  // For GAS compatibility, unless we already saw a .abiversion directive,
227  // set e_flags to indicate ELFv2 ABI.
228  unsigned Flags = MCA.getELFHeaderEFlags();
229  if ((Flags & ELF::EF_PPC64_ABI) == 0)
230  MCA.setELFHeaderEFlags(Flags | 2);
231  }
232 
233  void emitAssignment(MCSymbol *S, const MCExpr *Value) override {
234  auto *Symbol = cast<MCSymbolELF>(S);
235 
236  // When encoding an assignment to set symbol A to symbol B, also copy
237  // the st_other bits encoding the local entry point offset.
238  if (copyLocalEntry(Symbol, Value))
239  UpdateOther.insert(Symbol);
240  else
241  UpdateOther.erase(Symbol);
242  }
243 
244  void finish() override {
245  for (auto *Sym : UpdateOther)
246  if (Sym->isVariable())
247  copyLocalEntry(Sym, Sym->getVariableValue());
248 
249  // Clear the set of symbols that needs to be updated so the streamer can
250  // be reused without issues.
251  UpdateOther.clear();
252  }
253 
254 private:
255  SmallPtrSet<MCSymbolELF *, 32> UpdateOther;
256 
257  bool copyLocalEntry(MCSymbolELF *D, const MCExpr *S) {
258  auto *Ref = dyn_cast<const MCSymbolRefExpr>(S);
259  if (!Ref)
260  return false;
261  const auto &RhsSym = cast<MCSymbolELF>(Ref->getSymbol());
262  unsigned Other = D->getOther();
264  Other |= RhsSym.getOther() & ELF::STO_PPC64_LOCAL_MASK;
265  D->setOther(Other);
266  return true;
267  }
268 
269  unsigned encodePPC64LocalEntryOffset(const MCExpr *LocalOffset) {
270  MCAssembler &MCA = getStreamer().getAssembler();
271  int64_t Offset;
272  if (!LocalOffset->evaluateAsAbsolute(Offset, MCA))
274  LocalOffset->getLoc(), ".localentry expression must be absolute.");
275 
276  switch (Offset) {
277  default:
279  LocalOffset->getLoc(),
280  ".localentry expression is not a valid power of 2.");
281  case 0:
282  return 0;
283  case 1:
284  return 1 << ELF::STO_PPC64_LOCAL_BIT;
285  case 4:
286  case 8:
287  case 16:
288  case 32:
289  case 64:
290  return (int)Log2(Offset) << (int)ELF::STO_PPC64_LOCAL_BIT;
291  }
292  }
293 };
294 
295 class PPCTargetMachOStreamer : public PPCTargetStreamer {
296 public:
297  PPCTargetMachOStreamer(MCStreamer &S) : PPCTargetStreamer(S) {}
298 
299  void emitTCEntry(const MCSymbol &S,
301  llvm_unreachable("Unknown pseudo-op: .tc");
302  }
303 
304  void emitMachine(StringRef CPU) override {
305  // FIXME: We should update the CPUType, CPUSubType in the Object file if
306  // the new values are different from the defaults.
307  }
308 
309  void emitAbiVersion(int AbiVersion) override {
310  llvm_unreachable("Unknown pseudo-op: .abiversion");
311  }
312 
313  void emitLocalEntry(MCSymbolELF *S, const MCExpr *LocalOffset) override {
314  llvm_unreachable("Unknown pseudo-op: .localentry");
315  }
316 };
317 
318 class PPCTargetXCOFFStreamer : public PPCTargetStreamer {
319 public:
320  PPCTargetXCOFFStreamer(MCStreamer &S) : PPCTargetStreamer(S) {}
321 
322  void emitTCEntry(const MCSymbol &S,
324  const MCAsmInfo *MAI = Streamer.getContext().getAsmInfo();
325  const unsigned PointerSize = MAI->getCodePointerSize();
326  Streamer.emitValueToAlignment(PointerSize);
327  Streamer.emitValue(MCSymbolRefExpr::create(&S, Kind, Streamer.getContext()),
328  PointerSize);
329  }
330 
331  void emitMachine(StringRef CPU) override {
332  llvm_unreachable("Machine pseudo-ops are invalid for XCOFF.");
333  }
334 
335  void emitAbiVersion(int AbiVersion) override {
336  llvm_unreachable("ABI-version pseudo-ops are invalid for XCOFF.");
337  }
338 
339  void emitLocalEntry(MCSymbolELF *S, const MCExpr *LocalOffset) override {
340  llvm_unreachable("Local-entry pseudo-ops are invalid for XCOFF.");
341  }
342 };
343 
344 } // end anonymous namespace
345 
348  MCInstPrinter *InstPrint,
349  bool isVerboseAsm) {
350  return new PPCTargetAsmStreamer(S, OS);
351 }
352 
353 static MCTargetStreamer *
355  const Triple &TT = STI.getTargetTriple();
356  if (TT.isOSBinFormatELF())
357  return new PPCTargetELFStreamer(S);
358  if (TT.isOSBinFormatXCOFF())
359  return new PPCTargetXCOFFStreamer(S);
360  return new PPCTargetMachOStreamer(S);
361 }
362 
364  unsigned SyntaxVariant,
365  const MCAsmInfo &MAI,
366  const MCInstrInfo &MII,
367  const MCRegisterInfo &MRI) {
368  return new PPCInstPrinter(MAI, MII, MRI, T);
369 }
370 
374  // Register the MC asm info.
376 
377  // Register the MC instruction info.
379 
380  // Register the MC register info.
382 
383  // Register the MC subtarget info.
385 
386  // Register the MC Code Emitter
388 
389  // Register the asm backend.
391 
392  // Register the elf streamer.
394 
395  // Register the XCOFF streamer.
397 
398  // Register the object target streamer.
401 
402  // Register the asm target streamer.
404 
405  // Register the MCInstPrinter.
407  }
408 }
llvm::MCAssembler::getELFHeaderEFlags
unsigned getELFHeaderEFlags() const
ELF e_header flags.
Definition: MCAssembler.h:262
llvm::PPCXCOFFMCAsmInfo
Definition: PPCMCAsmInfo.h:29
MCDwarf.h
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
Reg
unsigned Reg
Definition: MachineSink.cpp:1558
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::X86AS::FS
@ FS
Definition: X86.h:188
PPCELFStreamer.h
T
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:72
StringRef.h
llvm::MCSymbolXCOFF::getSymbolTableName
StringRef getSymbolTableName() const
Definition: MCSymbolXCOFF.h:61
MCCodeEmitter.h
llvm::Target
Target - Wrapper for Target specific information.
Definition: TargetRegistry.h:137
llvm::MCAsmInfo
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
ErrorHandling.h
llvm::TargetRegistry::RegisterAsmTargetStreamer
static void RegisterAsmTargetStreamer(Target &T, Target::AsmTargetStreamerCtorTy Fn)
Definition: TargetRegistry.h:972
llvm::PPCTargetStreamer::~PPCTargetStreamer
~PPCTargetStreamer() override
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
MCAssembler.h
llvm::Triple::isOSBinFormatXCOFF
bool isOSBinFormatXCOFF() const
Tests whether the OS uses the XCOFF binary format.
Definition: Triple.h:658
llvm::MCAsmInfo::getCodePointerSize
unsigned getCodePointerSize() const
Get the code pointer size in bytes.
Definition: MCAsmInfo.h:536
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
llvm::SmallPtrSet
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
Definition: SmallPtrSet.h:449
llvm::createPPCMCCodeEmitter
MCCodeEmitter * createPPCMCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &Ctx)
Definition: PPCMCCodeEmitter.cpp:36
PPCMCAsmInfo.h
PPCMCTargetDesc.h
llvm::TargetRegistry::RegisterMCInstPrinter
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
Definition: TargetRegistry.h:930
llvm::createPPCXCOFFStreamer
MCXCOFFStreamer * createPPCXCOFFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
Definition: PPCXCOFFStreamer.cpp:71
MCELFStreamer.h
Context
ManagedStatic< detail::RecordContext > Context
Definition: Record.cpp:96
llvm::MCSymbolELF
Definition: MCSymbolELF.h:14
PPCInstPrinter.h
FormattedStream.h
llvm::getThePPC64LETarget
Target & getThePPC64LETarget()
Definition: PowerPCTargetInfo.cpp:25
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:199
ELF.h
llvm::MCELFStreamer
Definition: MCELFStreamer.h:24
MCAsmBackend.h
llvm::ModRefInfo::Ref
@ Ref
The access may reference the value stored in memory.
llvm::PPCELFMCAsmInfo
Definition: PPCMCAsmInfo.h:22
llvm::MCAssembler::getContext
MCContext & getContext() const
Definition: MCAssembler.h:292
llvm::PPCInstPrinter
Definition: PPCInstPrinter.h:21
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
createPPCMCInstrInfo
static MCInstrInfo * createPPCMCInstrInfo()
Definition: PPCMCTargetDesc.cpp:63
llvm::Log2
unsigned Log2(Align A)
Returns the log2 of the alignment.
Definition: Alignment.h:207
llvm::ELF::STO_PPC64_LOCAL_BIT
@ STO_PPC64_LOCAL_BIT
Definition: ELF.h:407
int
Clang compiles this i1 i64 store i64 i64 store i64 i64 store i64 i64 store i64 align Which gets codegen d xmm0 movaps rbp movaps rbp movaps rbp movaps rbp rbp rbp rbp rbp It would be better to have movq s of instead of the movaps s LLVM produces ret int
Definition: README.txt:536
llvm::MCSubtargetInfo::getTargetTriple
const Triple & getTargetTriple() const
Definition: MCSubtargetInfo.h:107
MCSymbolELF.h
MCContext.h
MCInstrInfo.h
MCSymbol.h
llvm::MCSymbolXCOFF::hasRename
bool hasRename() const
Definition: MCSymbolXCOFF.h:57
llvm::Triple::ppc64
@ ppc64
Definition: Triple.h:69
MCSubtargetInfo.h
Options
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
Definition: PassBuilderBindings.cpp:48
llvm::ELF::STO_PPC64_LOCAL_MASK
@ STO_PPC64_LOCAL_MASK
Definition: ELF.h:408
llvm::MCTargetStreamer
Target specific streamer interface.
Definition: MCStreamer.h:91
SmallPtrSet.h
llvm::MCSymbol::getName
StringRef getName() const
getName - Get the symbol name.
Definition: MCSymbol.h:198
llvm::Triple::getArch
ArchType getArch() const
Get the parsed architecture type of this triple.
Definition: Triple.h:312
llvm::MCContext::reportFatalError
void reportFatalError(SMLoc L, const Twine &Msg)
Definition: MCContext.cpp:982
MCSectionXCOFF.h
llvm::RegisterMCAsmInfoFn
RegisterMCAsmInfoFn - Helper template for registering a target assembly info implementation.
Definition: TargetRegistry.h:1097
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
llvm::MCCFIInstruction
Definition: MCDwarf.h:470
X
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
llvm::MCELFStreamer::emitValueToAlignment
void emitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
Definition: MCELFStreamer.cpp:365
createObjectTargetStreamer
static MCTargetStreamer * createObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
Definition: PPCMCTargetDesc.cpp:354
llvm::Triple::ppc64le
@ ppc64le
Definition: Triple.h:70
createPPCMCInstPrinter
static MCInstPrinter * createPPCMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
Definition: PPCMCTargetDesc.cpp:363
llvm::MCAssembler
Definition: MCAssembler.h:60
llvm::TargetRegistry::RegisterMCAsmBackend
static void RegisterMCAsmBackend(Target &T, Target::MCAsmBackendCtorTy Fn)
RegisterMCAsmBackend - Register a MCAsmBackend implementation for the given target.
Definition: TargetRegistry.h:877
llvm::MCSymbolRefExpr::VariantKind
VariantKind
Definition: MCExpr.h:194
D
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
createPPCMCSubtargetInfo
static MCSubtargetInfo * createPPCMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
Definition: PPCMCTargetDesc.cpp:80
llvm::MCInstPrinter
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:43
LLVM_EXTERNAL_VISIBILITY
#define LLVM_EXTERNAL_VISIBILITY
Definition: Compiler.h:132
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
MCSymbolXCOFF.h
PowerPCTargetInfo.h
llvm::TargetRegistry::RegisterObjectTargetStreamer
static void RegisterObjectTargetStreamer(Target &T, Target::ObjectTargetStreamerCtorTy Fn)
Definition: TargetRegistry.h:978
MCRegisterInfo.h
llvm::MCAssembler::setELFHeaderEFlags
void setELFHeaderEFlags(unsigned Flags)
Definition: MCAssembler.h:263
llvm::formatted_raw_ostream
formatted_raw_ostream - A raw_ostream that wraps another one and keeps track of line and column posit...
Definition: FormattedStream.h:30
PPCXCOFFStreamer.h
llvm::MCCFIInstruction::cfiDefCfa
static MCCFIInstruction cfiDefCfa(MCSymbol *L, unsigned Register, int Offset)
.cfi_def_cfa defines a rule for computing CFA as: take address from Register and add Offset to it.
Definition: MCDwarf.h:524
llvm::MCAsmInfo::addInitialFrameState
void addInitialFrameState(const MCCFIInstruction &Inst)
Definition: MCAsmInfo.cpp:86
RA
SI optimize exec mask operations pre RA
Definition: SIOptimizeExecMaskingPreRA.cpp:71
llvm::TargetRegistry::RegisterMCSubtargetInfo
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for the given target.
Definition: TargetRegistry.h:850
llvm::MCTargetOptions
Definition: MCTargetOptions.h:36
Triple.h
llvm::createPPCELFStreamer
MCELFStreamer * createPPCELFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
Definition: PPCELFStreamer.cpp:223
llvm::ELF::EF_PPC64_ABI
@ EF_PPC64_ABI
Definition: ELF.h:402
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:134
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::MCRegisterInfo
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Definition: MCRegisterInfo.h:135
llvm::PPCTargetStreamer::PPCTargetStreamer
PPCTargetStreamer(MCStreamer &S)
Definition: PPCMCTargetDesc.cpp:58
MRI
unsigned const MachineRegisterInfo * MRI
Definition: AArch64AdvSIMDScalarPass.cpp:105
llvm::getThePPC64Target
Target & getThePPC64Target()
Definition: PowerPCTargetInfo.cpp:21
MCObjectWriter.h
llvm::TargetRegistry::RegisterMCInstrInfo
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target.
Definition: TargetRegistry.h:817
llvm::TargetRegistry::RegisterMCCodeEmitter
static void RegisterMCCodeEmitter(Target &T, Target::MCCodeEmitterCtorTy Fn)
RegisterMCCodeEmitter - Register a MCCodeEmitter implementation for the given target.
Definition: TargetRegistry.h:943
llvm::MCInstrInfo
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:25
llvm::TargetRegistry::RegisterMCRegInfo
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
RegisterMCRegInfo - Register a MCRegisterInfo implementation for the given target.
Definition: TargetRegistry.h:837
llvm::TargetRegistry::RegisterELFStreamer
static void RegisterELFStreamer(Target &T, Target::ELFStreamerCtorTy Fn)
Definition: TargetRegistry.h:955
Casting.h
LLVMInitializePowerPCTargetMC
LLVM_EXTERNAL_VISIBILITY void LLVMInitializePowerPCTargetMC()
Definition: PPCMCTargetDesc.cpp:371
PPCTargetStreamer.h
llvm::MCSymbolRefExpr::create
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:386
llvm::MCSymbolRefExpr::getVariantKindName
static StringRef getVariantKindName(VariantKind Kind)
Definition: MCExpr.cpp:221
llvm::TargetRegistry::RegisterXCOFFStreamer
static void RegisterXCOFFStreamer(Target &T, Target::XCOFFStreamerCtorTy Fn)
Definition: TargetRegistry.h:963
llvm::getThePPC32LETarget
Target & getThePPC32LETarget()
Definition: PowerPCTargetInfo.cpp:17
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:83
createPPCMCRegisterInfo
static MCRegisterInfo * createPPCMCRegisterInfo(const Triple &TT)
Definition: PPCMCTargetDesc.cpp:69
CodeGen.h
createPPCMCAsmInfo
static MCAsmInfo * createPPCMCAsmInfo(const MCRegisterInfo &MRI, const Triple &TheTriple, const MCTargetOptions &Options)
Definition: PPCMCTargetDesc.cpp:95
llvm::MCExpr::print
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
Definition: MCExpr.cpp:42
llvm::MCSymbolXCOFF
Definition: MCSymbolXCOFF.h:20
llvm::createPPCAsmBackend
MCAsmBackend * createPPCAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
Definition: PPCAsmBackend.cpp:272
MCStreamer.h
createAsmTargetStreamer
static MCTargetStreamer * createAsmTargetStreamer(MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint, bool isVerboseAsm)
Definition: PPCMCTargetDesc.cpp:346
raw_ostream.h
TargetRegistry.h
MCExpr.h
llvm::PPCTargetStreamer
Definition: PPCTargetStreamer.h:21
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:75
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
Other
Optional< std::vector< StOtherPiece > > Other
Definition: ELFYAML.cpp:1195
llvm::MCExpr::getLoc
SMLoc getLoc() const
Definition: MCExpr.h:82
llvm::getThePPC32Target
Target & getThePPC32Target()
Definition: PowerPCTargetInfo.cpp:13