[clang] [NFC][clang-offload-bundler] Simplify main function (PR #138555)

via cfe-commits cfe-commits at lists.llvm.org
Mon May 5 10:06:04 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Alexey Bader (bader)

<details>
<summary>Changes</summary>

Applied "no else after return" rule from the LLVM's Coding Standards https://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return

---
Full diff: https://github.com/llvm/llvm-project/pull/138555.diff


1 Files Affected:

- (modified) clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp (+4-7) 


``````````diff
diff --git a/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp b/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
index 49412aeeba7fc..75de97068e6e9 100644
--- a/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
+++ b/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
@@ -426,12 +426,9 @@ int main(int argc, const char **argv) {
   OffloadBundler Bundler(BundlerConfig);
 
   return doWork([&]() {
-    if (Unbundle) {
-      if (BundlerConfig.FilesType == "a")
-        return Bundler.UnbundleArchive();
-      else
-        return Bundler.UnbundleFiles();
-    } else
-      return Bundler.BundleFiles();
+    if (Unbundle)
+      return (BundlerConfig.FilesType == "a") ? Bundler.UnbundleArchive()
+                                              : Bundler.UnbundleFiles();
+    return Bundler.BundleFiles();
   });
 }

``````````

</details>


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


More information about the cfe-commits mailing list