LLVM 22.0.0git
DXContainerObject.h
Go to the documentation of this file.
1//===- DXContainerObject.h --------------------------------------*- 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#ifndef LLVM_LIB_OBJCOPY_DXCONTAINER_DXCONTAINEROBJECT_H
10#define LLVM_LIB_OBJCOPY_DXCONTAINER_DXCONTAINEROBJECT_H
11
12#include "llvm/ADT/ArrayRef.h"
13#include "llvm/ADT/StringRef.h"
15
16namespace llvm {
17namespace objcopy {
18namespace dxbc {
19
20using namespace object;
21
22struct Part {
25
26 size_t size() const {
27 return sizeof(::llvm::dxbc::PartHeader) // base header
28 + Data.size(); // contents size
29 }
30};
31
33
34struct Object {
37
38 size_t headerSize() const {
39 return sizeof(::llvm::dxbc::Header) // base header
40 + sizeof(uint32_t) * Parts.size(); // part offset values
41 }
42
44 void recomputeHeader();
45};
46
47} // end namespace dxbc
48} // end namespace objcopy
49} // end namespace llvm
50
51#endif // LLVM_LIB_OBJCOPY_DXCONTAINER_DXCONTAINEROBJECT_H
ReachingDefInfo InstSet & ToRemove
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
An efficient, type-erasing, non-owning reference to a callable.
llvm::function_ref< bool(const Part &)> PartPred
This is an optimization pass for GlobalISel generic memory operations.
Use this type to describe the size and type of a DXIL container part.
Definition DXContainer.h:99
Error removeParts(PartPred ToRemove)
::llvm::dxbc::Header Header