LLVM 22.0.0git
MCGOFFStreamer.cpp
Go to the documentation of this file.
1//===- lib/MC/MCGOFFStreamer.cpp - GOFF 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 GOFF .o object files.
10//
11//===----------------------------------------------------------------------===//
12
15#include "llvm/MC/MCAssembler.h"
17#include "llvm/MC/MCContext.h"
20
21using namespace llvm;
22
24
28
30 // Make sure that all section are registered in the correct order.
32 for (auto *S = static_cast<MCSectionGOFF *>(Section); S; S = S->getParent())
33 Sections.push_back(S);
34 while (!Sections.empty()) {
35 auto *S = Sections.pop_back_val();
36 MCObjectStreamer::changeSection(S, Sections.empty() ? Subsection : 0);
37 }
38}
39
41 std::unique_ptr<MCAsmBackend> &&MAB,
42 std::unique_ptr<MCObjectWriter> &&OW,
43 std::unique_ptr<MCCodeEmitter> &&CE) {
45 new MCGOFFStreamer(Context, std::move(MAB), std::move(OW), std::move(CE));
46 return S;
47}
49 std::unique_ptr<MCAsmBackend> MAB,
50 std::unique_ptr<MCObjectWriter> OW,
51 std::unique_ptr<MCCodeEmitter> Emitter)
52 : MCObjectStreamer(Context, std::move(MAB), std::move(OW),
53 std::move(Emitter)) {}
dxil DXContainer Global Emitter
MCObjectWriter & getWriter() const
Context object for machine code objects.
Definition MCContext.h:83
void changeSection(MCSection *Section, uint32_t Subsection=0) override
This is called by popSection and switchSection, if the current section changes.
GOFFObjectWriter & getWriter()
MCGOFFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
MCAssembler & getAssembler()
MCObjectStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
void changeSection(MCSection *Section, uint32_t Subsection=0) override
This is called by popSection and switchSection, if the current section changes.
MCSectionGOFF * getParent() const
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition MCSection.h:496
Streaming machine code generation interface.
Definition MCStreamer.h:220
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This is an optimization pass for GlobalISel generic memory operations.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1849
LLVM_ABI MCStreamer * createGOFFStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&CE)
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:851