-
Notifications
You must be signed in to change notification settings - Fork 14.3k
GCStrategy: Use Twine properly for error message #132760
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
GCStrategy: Use Twine properly for error message #132760
Conversation
@llvm/pr-subscribers-llvm-transforms @llvm/pr-subscribers-llvm-ir Author: Matt Arsenault (arsenm) ChangesAvoid unnecessary std::string temporaries. Full diff: https://github.com/llvm/llvm-project/pull/132760.diff 1 Files Affected:
diff --git a/llvm/lib/IR/GCStrategy.cpp b/llvm/lib/IR/GCStrategy.cpp
index c3e35bd58d13e..67f363d26b25f 100644
--- a/llvm/lib/IR/GCStrategy.cpp
+++ b/llvm/lib/IR/GCStrategy.cpp
@@ -41,10 +41,9 @@ std::unique_ptr<GCStrategy> llvm::getGCStrategy(const StringRef Name) {
// be the builtin GCs if nothing else. The most likely scenario here is
// that we got here without running the initializers used by the Registry
// itself and it's registration mechanism.
- const std::string error =
- std::string("unsupported GC: ") + Name.str() +
- " (did you remember to link and initialize the library?)";
- report_fatal_error(Twine(error));
+ report_fatal_error(
+ "unsupported GC: " + Name +
+ " (did you remember to link and initialize the library?)");
} else
- report_fatal_error(Twine(std::string("unsupported GC: ") + Name.str()));
+ report_fatal_error(Twine("unsupported GC: ") + Name);
}
|
ping |
Avoid unnecessary std::string temporaries.
0cf71d7
to
9820044
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/66/builds/12287 Here is the relevant piece of the build log for the reference
|
Avoid unnecessary std::string temporaries.