aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ObjCopy/DXContainer/DXContainerObject.cpp
blob: b845478de16d8f709fdc4df43a08d2fb84f5adb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//===- DXContainerObject.cpp ----------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "DXContainerObject.h"

namespace llvm {
namespace objcopy {
namespace dxbc {

Error Object::removeParts(PartPred ToRemove) {
  erase_if(Parts, ToRemove);
  return Error::success();
}

void Object::recomputeHeader() {
  Header.FileSize = headerSize();
  Header.PartCount = Parts.size();
  for (const Part &P : Parts)
    Header.FileSize += P.size();
}

} // end namespace dxbc
} // end namespace objcopy
} // end namespace llvm