Skip to content

Commit 5909b23

Browse files
committed
GCStrategy: Use Twine properly for error message
Avoid unnecessary std::string temporaries.
1 parent 0d19efa commit 5909b23

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/IR/GCStrategy.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ std::unique_ptr<GCStrategy> llvm::getGCStrategy(const StringRef Name) {
4141
// be the builtin GCs if nothing else. The most likely scenario here is
4242
// that we got here without running the initializers used by the Registry
4343
// itself and it's registration mechanism.
44-
const std::string error =
45-
std::string("unsupported GC: ") + Name.str() +
46-
" (did you remember to link and initialize the library?)";
47-
report_fatal_error(Twine(error));
44+
report_fatal_error(
45+
"unsupported GC: " + Name +
46+
" (did you remember to link and initialize the library?)");
4847
} else
49-
report_fatal_error(Twine(std::string("unsupported GC: ") + Name.str()));
48+
report_fatal_error(Twine("unsupported GC: ") + Name);
5049
}

0 commit comments

Comments
 (0)