| 1 | //===- DXContainerObject.cpp ----------------------------------------------===// |
|---|---|
| 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 | #include "DXContainerObject.h" |
| 10 | |
| 11 | namespace llvm { |
| 12 | namespace objcopy { |
| 13 | namespace dxbc { |
| 14 | |
| 15 | Error Object::removeParts(PartPred ToRemove) { |
| 16 | erase_if(C&: Parts, P: ToRemove); |
| 17 | return Error::success(); |
| 18 | } |
| 19 | |
| 20 | void Object::recomputeHeader() { |
| 21 | Header.FileSize = headerSize(); |
| 22 | Header.PartCount = Parts.size(); |
| 23 | for (const Part &P : Parts) |
| 24 | Header.FileSize += P.size(); |
| 25 | } |
| 26 | |
| 27 | } // end namespace dxbc |
| 28 | } // end namespace objcopy |
| 29 | } // end namespace llvm |
| 30 |