[llvm-branch-commits] [llvm] [DirectX] Add `split-section` to `llvm-objcopy` and implement it for `DXContainer` (PR #153265)
Helena Kotas via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Aug 13 15:42:10 PDT 2025
================
@@ -28,6 +52,31 @@ static Error handleArgs(const CommonConfig &Config, Object &Obj) {
return Config.ToRemove.matches(P.Name);
};
+ if (!Config.SplitSection.empty()) {
+ for (StringRef Flag : Config.SplitSection) {
+ StringRef SectionName;
+ StringRef FileName;
+ std::tie(SectionName, FileName) = Flag.split('=');
+
+ if (Error E = splitPartAsObject(SectionName, FileName,
+ Config.InputFilename, Obj))
+ return E;
+ }
+
+ RemovePred = [&Config, RemovePred](const Part &P) {
----------------
hekota wrote:
Reusing the same `RemovePred` here is a bit confusing.
```suggestion
RemovePred = [&Config, OriginalRemovePred](const Part &P) {
```
https://github.com/llvm/llvm-project/pull/153265
More information about the llvm-branch-commits
mailing list