[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) {
+ if (RemovePred(P))
+ return true;
+
+ for (StringRef Flag : Config.SplitSection) {
+ StringRef SectionName = Flag.take_front(Flag.find('='));
+ if (P.Name == SectionName)
+ return true;
----------------
hekota wrote:
```suggestion
if (Flag.starts_with(P.Name) && Flag[P.Name.size()] == '=')
return true;
```
https://github.com/llvm/llvm-project/pull/153265
More information about the llvm-branch-commits
mailing list