From 41a9ee98f9fb16d463667e28e56fb42c962e91ce Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 11 Oct 2017 23:54:34 +0000 Subject: Revert "[ADT] Make Twine's copy constructor private." This reverts commit 4e4ee1c507e2707bb3c208e1e1b6551c3015cbf5. This is failing due to some code that isn't built on MSVC so I didn't catch. Not immediately obvious how to fix this at first glance, so I'm reverting for now. llvm-svn: 315536 --- llvm/tools/llvm-nm/llvm-nm.cpp | 4 ++-- llvm/tools/llvm-objcopy/Object.cpp | 6 +++--- llvm/tools/llvm-objcopy/Object.h | 6 +++--- llvm/tools/llvm-objcopy/llvm-objcopy.cpp | 2 +- llvm/tools/llvm-objcopy/llvm-objcopy.h | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'llvm/tools') diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp index 6b9ae463979..4ad0d95d67f 100644 --- a/llvm/tools/llvm-nm/llvm-nm.cpp +++ b/llvm/tools/llvm-nm/llvm-nm.cpp @@ -195,12 +195,12 @@ bool HadError = false; std::string ToolName; } // anonymous namespace -static void error(const Twine &Message, const Twine &Path = Twine()) { +static void error(Twine Message, Twine Path = Twine()) { HadError = true; errs() << ToolName << ": " << Path << ": " << Message << ".\n"; } -static bool error(std::error_code EC, const Twine &Path = Twine()) { +static bool error(std::error_code EC, Twine Path = Twine()) { if (EC) { error(EC.message(), Path); return true; diff --git a/llvm/tools/llvm-objcopy/Object.cpp b/llvm/tools/llvm-objcopy/Object.cpp index f4c159cd1cb..f9acf001ae9 100644 --- a/llvm/tools/llvm-objcopy/Object.cpp +++ b/llvm/tools/llvm-objcopy/Object.cpp @@ -428,15 +428,15 @@ void initRelocations(RelocationSection *Relocs, } } -SectionBase *SectionTableRef::getSection(uint16_t Index, const Twine &ErrMsg) { +SectionBase *SectionTableRef::getSection(uint16_t Index, Twine ErrMsg) { if (Index == SHN_UNDEF || Index > Sections.size()) error(ErrMsg); return Sections[Index - 1].get(); } template -T *SectionTableRef::getSectionOfType(uint16_t Index, const Twine &IndexErrMsg, - const Twine &TypeErrMsg) { +T *SectionTableRef::getSectionOfType(uint16_t Index, Twine IndexErrMsg, + Twine TypeErrMsg) { if (T *Sec = llvm::dyn_cast(getSection(Index, IndexErrMsg))) return Sec; error(TypeErrMsg); diff --git a/llvm/tools/llvm-objcopy/Object.h b/llvm/tools/llvm-objcopy/Object.h index d266912db0b..f6088434805 100644 --- a/llvm/tools/llvm-objcopy/Object.h +++ b/llvm/tools/llvm-objcopy/Object.h @@ -29,11 +29,11 @@ public: : Sections(Secs) {} SectionTableRef(const SectionTableRef &) = default; - SectionBase *getSection(uint16_t Index, const llvm::Twine &ErrMsg); + SectionBase *getSection(uint16_t Index, llvm::Twine ErrMsg); template - T *getSectionOfType(uint16_t Index, const llvm::Twine &IndexErrMsg, - const llvm::Twine &TypeErrMsg); + T *getSectionOfType(uint16_t Index, llvm::Twine IndexErrMsg, + llvm::Twine TypeErrMsg); }; class SectionBase { diff --git a/llvm/tools/llvm-objcopy/llvm-objcopy.cpp b/llvm/tools/llvm-objcopy/llvm-objcopy.cpp index 9fc2897959c..7f55a434b33 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(const Twine &Message) { +LLVM_ATTRIBUTE_NORETURN void error(Twine Message) { errs() << ToolName << ": " << Message << ".\n"; errs().flush(); exit(1); diff --git a/llvm/tools/llvm-objcopy/llvm-objcopy.h b/llvm/tools/llvm-objcopy/llvm-objcopy.h index d30b43a46a4..de7bf367ac8 100644 --- a/llvm/tools/llvm-objcopy/llvm-objcopy.h +++ b/llvm/tools/llvm-objcopy/llvm-objcopy.h @@ -14,7 +14,7 @@ namespace llvm { -LLVM_ATTRIBUTE_NORETURN extern void error(const Twine &Message); +LLVM_ATTRIBUTE_NORETURN extern void error(Twine Message); // This is taken from llvm-readobj. // [see here](llvm/tools/llvm-readobj/llvm-readobj.h:38) -- cgit v1.2.3