LLVM  10.0.0svn
MCXCOFFStreamer.cpp
Go to the documentation of this file.
1 //===- lib/MC/MCXCOFFStreamer.cpp - XCOFF Object Output -------------------===//
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 assembles .s files and emits XCOFF .o object files.
10 //
11 //===----------------------------------------------------------------------===//
12 
14 #include "llvm/MC/MCAsmBackend.h"
15 #include "llvm/MC/MCCodeEmitter.h"
16 #include "llvm/MC/MCObjectWriter.h"
18 
19 using namespace llvm;
20 
22  std::unique_ptr<MCAsmBackend> MAB,
23  std::unique_ptr<MCObjectWriter> OW,
24  std::unique_ptr<MCCodeEmitter> Emitter)
25  : MCObjectStreamer(Context, std::move(MAB), std::move(OW),
26  std::move(Emitter)) {}
27 
30  report_fatal_error("Symbol attributes not implemented for XCOFF.");
31 }
32 
34  unsigned ByteAlignment) {
35  report_fatal_error("Emiting common symbols not implemented for XCOFF.");
36 }
37 
39  uint64_t Size, unsigned ByteAlignment,
40  SMLoc Loc) {
41  report_fatal_error("Zero fill not implemented for XCOFF.");
42 }
43 
45  const MCSubtargetInfo &) {
46  report_fatal_error("Instruction emission not implemented for XCOFF.");
47 }
48 
50  std::unique_ptr<MCAsmBackend> &&MAB,
51  std::unique_ptr<MCObjectWriter> &&OW,
52  std::unique_ptr<MCCodeEmitter> &&CE,
53  bool RelaxAll) {
54  MCXCOFFStreamer *S = new MCXCOFFStreamer(Context, std::move(MAB),
55  std::move(OW), std::move(CE));
56  if (RelaxAll)
57  S->getAssembler().setRelaxAll(true);
58  return S;
59 }
60 
62  unsigned ByteAlign) {
63  report_fatal_error("Emission of local commons not implemented yet.");
64 }
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:38
LLVMContext & Context
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Definition: Error.cpp:139
This class represents lattice values for constants.
Definition: AllocatorList.h:23
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override
Add the given Attribute to Symbol.
void EmitZerofill(MCSection *Section, MCSymbol *Symbol=nullptr, uint64_t Size=0, unsigned ByteAlignment=0, SMLoc Loc=SMLoc()) override
Emit the zerofill section and an optional symbol.
void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &) override
Definition: BitVector.h:937
MCStreamer * createXCOFFStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&CE, bool RelaxAll)
void setRelaxAll(bool Value)
Definition: MCAssembler.h:321
Context object for machine code objects.
Definition: MCContext.h:65
Streaming object file generation interface.
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:158
Streaming machine code generation interface.
Definition: MCStreamer.h:189
MCAssembler & getAssembler()
void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
Emit a common symbol.
MCSymbolAttr
Definition: MCDirectives.h:18
Generic base class for all target subtargets.
uint32_t Size
Definition: Profile.cpp:46
MCXCOFFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
Represents a location in source code.
Definition: SMLoc.h:23
void EmitXCOFFLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlign) override
Emits an lcomm directive with XCOFF csect information.