Skip to content

[LLVM][AArch64][NFC] Remove redundant copy parameter in method #110300

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

Conversation

AmrDeveloper
Copy link
Member

@AmrDeveloper AmrDeveloper commented Sep 27, 2024

Remove redundant copy parameter in method

Fixes #94233

@llvmbot
Copy link
Member

llvmbot commented Sep 27, 2024

@llvm/pr-subscribers-backend-aarch64

Author: Amr Hesham (AmrDeveloper)

Changes

Remove redundant copy parameter in lambda

Fixes #94233


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

1 Files Affected:

  • (modified) llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h (+1-1)
diff --git a/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h b/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h
index 72f110cebbdc8f..275f9739c5e111 100644
--- a/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h
+++ b/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h
@@ -303,7 +303,7 @@ class AArch64FunctionInfo final : public MachineFunctionInfo {
   void setLocalStackSize(uint64_t Size) { LocalStackSize = Size; }
   uint64_t getLocalStackSize() const { return LocalStackSize; }
 
-  void setOutliningStyle(std::string Style) { OutliningStyle = Style; }
+  void setOutliningStyle(const std::string& Style) { OutliningStyle = Style; }
   std::optional<std::string> getOutliningStyle() const {
     return OutliningStyle;
   }

Copy link

github-actions bot commented Sep 27, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@AmrDeveloper AmrDeveloper force-pushed the code_quality_aarch_str_pointless_copy branch from 136ce34 to caff17e Compare September 27, 2024 17:12
@AmrDeveloper AmrDeveloper force-pushed the code_quality_aarch_str_pointless_copy branch 2 times, most recently from 9bcab40 to 9206560 Compare September 29, 2024 12:59
Copy link
Collaborator

@DavidSpickett DavidSpickett left a comment

Choose a reason for hiding this comment

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

I agree with the change, most setters take a const ref.

But this is a member function not a lambda.

@AmrDeveloper AmrDeveloper force-pushed the code_quality_aarch_str_pointless_copy branch from 9206560 to 9bcb88f Compare October 15, 2024 16:17
@AmrDeveloper AmrDeveloper changed the title [LLVM][NFC] Remove redundant copy parameter in lambda [LLVM][NFC] Remove redundant copy parameter in method Oct 15, 2024
@AmrDeveloper
Copy link
Member Author

I agree with the change, most setters take a const ref.

But this is a member function not a lambda.

Thank you, i think i mixed the title with the other PR,

Updated it

@DavidSpickett DavidSpickett changed the title [LLVM][NFC] Remove redundant copy parameter in method [LLVM][AArch64][NFC] Remove redundant copy parameter in method Oct 16, 2024
@DavidSpickett DavidSpickett merged commit 2122302 into llvm:main Oct 16, 2024
8 checks passed
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.

llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h:285: Pointless string copy ?
3 participants