]> granicus.if.org Git - clang/commit
[ADT] Make Twine's copy constructor private.
authorZachary Turner <zturner@google.com>
Wed, 11 Oct 2017 23:33:06 +0000 (23:33 +0000)
committerZachary Turner <zturner@google.com>
Wed, 11 Oct 2017 23:33:06 +0000 (23:33 +0000)
commit29b9ec05e6c5cea54aa7dd4b7a8d586915ed55f1
tree8e3e8cad36a31a6a80f83a90e076a62dc6dd940e
parentf8e070853ea3632dad727597ce2177fd62346d5c
[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/cfe/trunk@315530 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Tooling/CompilationDatabase.h
lib/CodeGen/CGObjCMac.cpp
lib/CodeGen/CodeGenAction.cpp
lib/Driver/ToolChains/MSVC.cpp
lib/Driver/ToolChains/MinGW.cpp
lib/Tooling/CompilationDatabase.cpp
unittests/Tooling/TestVisitor.h