[llvm] [DirectX] Add `extract-section` to `llvm-objcopy` and implement it for `DXContainer` (PR #154804)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 21 10:56:14 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- llvm/include/llvm/ObjCopy/CommonConfig.h llvm/lib/ObjCopy/ConfigManager.cpp llvm/lib/ObjCopy/DXContainer/DXContainerObjcopy.cpp llvm/tools/llvm-objcopy/ObjcopyOptions.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/ObjCopy/DXContainer/DXContainerObjcopy.cpp b/llvm/lib/ObjCopy/DXContainer/DXContainerObjcopy.cpp
index 66ebe0016..4e0fd9d6f 100644
--- a/llvm/lib/ObjCopy/DXContainer/DXContainerObjcopy.cpp
+++ b/llvm/lib/ObjCopy/DXContainer/DXContainerObjcopy.cpp
@@ -20,7 +20,7 @@ namespace dxbc {
 using namespace object;
 
 static Error extractPartAsObject(StringRef PartName, StringRef OutFilename,
-                               StringRef InputFilename, const Object &Obj) {
+                                 StringRef InputFilename, const Object &Obj) {
   for (const Part &P : Obj.Parts)
     if (P.Name == PartName) {
       Object PartObj;
@@ -56,8 +56,8 @@ static Error handleArgs(const CommonConfig &Config, Object &Obj) {
     StringRef SectionName;
     StringRef FileName;
     std::tie(SectionName, FileName) = Flag.split('=');
-    if (Error E =
-            extractPartAsObject(SectionName, FileName, Config.InputFilename, Obj))
+    if (Error E = extractPartAsObject(SectionName, FileName,
+                                      Config.InputFilename, Obj))
       return E;
   }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/154804


More information about the llvm-commits mailing list