summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objcopy/llvm-objcopy.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-10-11 23:33:06 +0000
committerZachary Turner <zturner@google.com>2017-10-11 23:33:06 +0000
commit337462b36512cc001891a98fb98fa5693651722f (patch)
tree4b1708ba51865a9a5611fe209082e9ace07e7a8d /llvm/tools/llvm-objcopy/llvm-objcopy.cpp
parentd791eaa5594053918e517439469e7747bd52d91c (diff)
downloadbcm5719-llvm-337462b36512cc001891a98fb98fa5693651722f.tar.gz
bcm5719-llvm-337462b36512cc001891a98fb98fa5693651722f.zip
[ADT] Make Twine's copy constructor private.
There's a lot of misuse of Twine scattered around LLVM. This ranges in severity from benign (returning a Twine from a function by value that is just a string literal) to pretty sketchy (storing a Twine by value in a class). While there are some uses for copying Twines, most of the very compelling ones are confined to the Twine class implementation itself, and other uses are either dubious or easily worked around. This patch makes Twine's copy constructor private, and fixes up all callsites. Differential Revision: https://reviews.llvm.org/D38767 llvm-svn: 315530
Diffstat (limited to 'llvm/tools/llvm-objcopy/llvm-objcopy.cpp')
-rw-r--r--llvm/tools/llvm-objcopy/llvm-objcopy.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/llvm-objcopy/llvm-objcopy.cpp b/llvm/tools/llvm-objcopy/llvm-objcopy.cpp
index 7f55a434b33..9fc2897959c 100644
--- a/llvm/tools/llvm-objcopy/llvm-objcopy.cpp
+++ b/llvm/tools/llvm-objcopy/llvm-objcopy.cpp
@@ -27,7 +27,7 @@ static StringRef ToolName;
namespace llvm {
-LLVM_ATTRIBUTE_NORETURN void error(Twine Message) {
+LLVM_ATTRIBUTE_NORETURN void error(const Twine &Message) {
errs() << ToolName << ": " << Message << ".\n";
errs().flush();
exit(1);
OpenPOWER on IntegriCloud