15using namespace object;
17size_t DXContainerWriter::finalize() {
19 "Attempted to finalize writer with already computed offsets");
20 Offsets.reserve(Obj.Parts.size());
21 size_t Offset = Obj.headerSize();
22 for (
const Part &
P : Obj.Parts) {
26 return Obj.Header.FileSize;
31 Out.reserveExtraSpace(TotalSize);
36 Out.write(
reinterpret_cast<const char *
>(&Header),
39 for (
auto &O : Offsets)
41 Out.write(
reinterpret_cast<const char *
>(Offsets.data()),
44 for (
const Part &
P : Obj.Parts) {
45 Out.write(
reinterpret_cast<const char *
>(
P.Name.data()), 4);
49 Out.write(
reinterpret_cast<const char *
>(&
Size),
sizeof(
uint32_t));
50 Out.write(
reinterpret_cast<const char *
>(
P.Data.data()),
P.Data.size());
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
constexpr bool IsBigEndianHost
void swapByteOrder(T &Value)
This is an optimization pass for GlobalISel generic memory operations.