Skip to content

[CommandLine][NFC] Replace 'std::function' with 'function_ref' #75973

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
Dec 19, 2023

Conversation

igorkudrin
Copy link
Collaborator

This implements a post-commit suggestion for #75679.

@llvmbot
Copy link
Member

llvmbot commented Dec 19, 2023

@llvm/pr-subscribers-llvm-support

Author: Igor Kudrin (igorkudrin)

Changes

This implements a post-commit suggestion for #75679.


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

1 Files Affected:

  • (modified) llvm/lib/Support/CommandLine.cpp (+1-2)
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index 00179bc32551fe..368dead4491492 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -175,8 +175,7 @@ class CommandLineParser {
                                StringRef Overview, raw_ostream *Errs = nullptr,
                                bool LongOptionsUseDoubleDash = false);
 
-  void forEachSubCommand(Option &Opt,
-                         std::function<void(SubCommand &)> Action) {
+  void forEachSubCommand(Option &Opt, function_ref<void(SubCommand &)> Action) {
     if (Opt.Subs.empty()) {
       Action(SubCommand::getTopLevel());
       return;

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@igorkudrin igorkudrin merged commit 98e20e1 into llvm:main Dec 19, 2023
@igorkudrin igorkudrin deleted the cl-function-ref branch December 19, 2023 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants