LLVM 22.0.0git
DXILBitcodeWriter.h
Go to the documentation of this file.
1//===- Bitcode/Writer/DXILBitcodeWriter.cpp - DXIL Bitcode Writer ---------===//
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// Bitcode writer implementation.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_DXILWRITER_DXILBITCODEWRITER_H
14#define LLVM_DXILWRITER_DXILBITCODEWRITER_H
15
16#include "llvm/ADT/StringRef.h"
21#include <memory>
22#include <vector>
23
24namespace llvm {
25
26class BitstreamWriter;
27class Module;
28class raw_ostream;
29
30namespace dxil {
31
34 std::unique_ptr<BitstreamWriter> Stream;
35
37
38 // Owns any strings created by the irsymtab writer until we create the
39 // string table.
40 BumpPtrAllocator Alloc;
41
42 void writeBlob(unsigned Block, unsigned Record, StringRef Blob);
43
44 std::vector<Module *> Mods;
45
46public:
47 /// Create a BitcodeWriter that writes to Buffer.
49
51
52 /// Write the specified module to the buffer specified at construction time.
53 void writeModule(const Module &M);
54};
55
56/// Write the specified module to the specified raw output stream.
57///
58/// For streams where it matters, the given stream should be in "binary"
59/// mode.
60void WriteDXILToFile(const Module &M, raw_ostream &Out);
61
62} // namespace dxil
63
64} // namespace llvm
65
66#endif // LLVM_DXILWRITER_DXILBITCODEWRITER_H
This file defines the BumpPtrAllocator interface.
ModuleSummaryIndex.h This file contains the declarations the classes that hold the module index and s...
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
Utility for building string tables with deduplicated suffixes.
void writeModule(const Module &M)
Write the specified module to the buffer specified at construction time.
BitcodeWriter(SmallVectorImpl< char > &Buffer)
Create a BitcodeWriter that writes to Buffer.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
void WriteDXILToFile(const Module &M, raw_ostream &Out)
Write the specified module to the specified raw output stream.
This is an optimization pass for GlobalISel generic memory operations.
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Definition Allocator.h:383