LLVM 20.0.0git
MCDXContainerStreamer.h
Go to the documentation of this file.
1//===- MCDXContainerStreamer.h - MCDXContainerStreamer Interface ---*- 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// Overrides MCObjectStreamer to disable all unnecessary features with stubs.
10// The DXContainer format isn't a fully featured object format. It doesn't
11// support symbols, and initially it will not support instruction data since it
12// is used as a bitcode container for DXIL.
13//
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_MC_MCDXCONTAINERSTREAMER_H
17#define LLVM_MC_MCDXCONTAINERSTREAMER_H
18
23
24namespace llvm {
25class MCInst;
26class raw_ostream;
27
29public:
30 MCDXContainerStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
31 std::unique_ptr<MCObjectWriter> OW,
32 std::unique_ptr<MCCodeEmitter> Emitter)
33 : MCObjectStreamer(Context, std::move(TAB), std::move(OW),
34 std::move(Emitter)) {}
35
36 bool emitSymbolAttribute(MCSymbol *, MCSymbolAttr) override { return false; }
38 void emitZerofill(MCSection *, MCSymbol *Symbol = nullptr, uint64_t Size = 0,
39 Align ByteAlignment = Align(1),
40 SMLoc Loc = SMLoc()) override {}
41
42private:
43 void emitInstToData(const MCInst &, const MCSubtargetInfo &) override;
44};
45
46} // end namespace llvm
47
48#endif // LLVM_MC_MCDXCONTAINERSTREAMER_H
dxil DXContainer Global Emitter
uint64_t Size
Context object for machine code objects.
Definition: MCContext.h:83
void emitCommonSymbol(MCSymbol *, uint64_t, Align) override
Emit a common symbol.
MCDXContainerStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
bool emitSymbolAttribute(MCSymbol *, MCSymbolAttr) override
Add the given Attribute to Symbol.
void emitZerofill(MCSection *, MCSymbol *Symbol=nullptr, uint64_t Size=0, Align ByteAlignment=Align(1), SMLoc Loc=SMLoc()) override
Emit the zerofill section and an optional symbol.
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
Streaming object file generation interface.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:36
Generic base class for all target subtargets.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
Represents a location in source code.
Definition: SMLoc.h:23
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
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:1856
MCSymbolAttr
Definition: MCDirectives.h:18
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:858
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39