diff options
author | Zachary Turner <zturner@google.com> | 2017-10-11 23:33:06 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-10-11 23:33:06 +0000 |
commit | dc62a47c34a9bc82054e4e221c10c4592c89eea3 (patch) | |
tree | 6f4d538c1a1a44160ff01391e15b2d1eb0b30005 /lib/Support/Error.cpp | |
parent | 3a5178e70a91ad23d2aa3c24a52eace3c61cab08 (diff) | |
download | llvm-dc62a47c34a9bc82054e4e221c10c4592c89eea3.tar.gz |
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315530 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Error.cpp')
-rw-r--r-- | lib/Support/Error.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/Error.cpp b/lib/Support/Error.cpp index bb02c03ff2b6..fe8ffd817f4e 100644 --- a/lib/Support/Error.cpp +++ b/lib/Support/Error.cpp @@ -54,7 +54,7 @@ char ErrorList::ID = 0; char ECError::ID = 0; char StringError::ID = 0; -void logAllUnhandledErrors(Error E, raw_ostream &OS, Twine ErrorBanner) { +void logAllUnhandledErrors(Error E, raw_ostream &OS, const Twine &ErrorBanner) { if (!E) return; OS << ErrorBanner; |