Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2025
Merged

Conversation

bader
Copy link
Contributor

@bader bader commented May 5, 2025

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

@llvmbot llvmbot added the clang Clang issues not falling into any other category label May 5, 2025
@llvmbot
Copy link
Member

llvmbot commented May 5, 2025

@llvm/pr-subscribers-clang

Author: Alexey Bader (bader)

Changes

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 --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();
   });
 }

@bader bader requested a review from yxsamliu May 5, 2025 17:06
@bader bader merged commit 3f1267e into llvm:main May 6, 2025
13 checks passed
GeorgeARM pushed a commit to GeorgeARM/llvm-project that referenced this pull request May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants