[llvm-branch-commits] [llvm] [DirectX] Add support for `remove-section` of `DXContainer` for `llvm-objcopy` (PR #153246)
James Henderson via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Aug 14 03:10:28 PDT 2025
================
@@ -0,0 +1,30 @@
+//===- 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);
+ recomputeHeader();
----------------
jh7370 wrote:
Thinking ahead to when other options are added, should this be done outside `removeParts`, in `handleArgs` or similar? If, for example, you add the ability to add a section, you'll presumably need to recompute and you should probably only do that once after all the changes have been made.
https://github.com/llvm/llvm-project/pull/153246
More information about the llvm-branch-commits
mailing list