Skip to content

llvm/tools/llvm-cgdata/llvm-cgdata.cpp:69: 2 * clumsy string parameter passing #100065

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

Closed
dcb314 opened this issue Jul 23, 2024 · 0 comments · Fixed by #120771
Closed

llvm/tools/llvm-cgdata/llvm-cgdata.cpp:69: 2 * clumsy string parameter passing #100065

dcb314 opened this issue Jul 23, 2024 · 0 comments · Fixed by #120771
Labels
code-quality llvm-tools All llvm tools that do not have corresponding tag

Comments

@dcb314
Copy link

dcb314 commented Jul 23, 2024

Static analyser cppcheck says:

trunk/llvm/tools/llvm-cgdata/llvm-cgdata.cpp:69:39: performance: Function parameter 'Hint' should be passed by const reference. [passedByValue]
trunk/llvm/tools/llvm-cgdata/llvm-cgdata.cpp:68:54: performance: Function parameter 'Whence' should be passed by const reference. [passedByValue]

Source code is

static void exitWithError(Twine Message, std::string Whence = "",
std::string Hint = "") {

@EugeneZelenko EugeneZelenko added llvm-tools All llvm tools that do not have corresponding tag and removed llvm:codegen labels Jul 23, 2024
AmrDeveloper added a commit that referenced this issue Jan 20, 2025
…on (#120771)

Replace `static void exitWithError(Twine Message, std::string Whence =
"", std::string Hint = "")` std::string with StringRef to remove
constructing Strings on every call or passing by value

Fixes: #100065
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-quality llvm-tools All llvm tools that do not have corresponding tag
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants