summaryrefslogtreecommitdiff
path: root/tools/llvm-objcopy
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-10-11 23:54:34 +0000
committerZachary Turner <zturner@google.com>2017-10-11 23:54:34 +0000
commitd4118422e7e5716d373d94605d4822ec32790833 (patch)
tree26929e7e5f1ab40243b7101a976198d273c2d402 /tools/llvm-objcopy
parent1c59d0201f474dcaa67fee66506b8567cfd3c1cb (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315536 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-objcopy')
-rw-r--r--tools/llvm-objcopy/Object.cpp6
-rw-r--r--tools/llvm-objcopy/Object.h6
-rw-r--r--tools/llvm-objcopy/llvm-objcopy.cpp2
-rw-r--r--tools/llvm-objcopy/llvm-objcopy.h2
4 files changed, 8 insertions, 8 deletions
diff --git a/tools/llvm-objcopy/Object.cpp b/tools/llvm-objcopy/Object.cpp
index f4c159cd1cb..f9acf001ae9 100644
--- a/tools/llvm-objcopy/Object.cpp
+++ b/tools/llvm-objcopy/Object.cpp
@@ -428,15 +428,15 @@ void initRelocations(RelocationSection<ELFT> *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 <class T>
-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<T>(getSection(Index, IndexErrMsg)))
return Sec;
error(TypeErrMsg);
diff --git a/tools/llvm-objcopy/Object.h b/tools/llvm-objcopy/Object.h
index d266912db0b..f6088434805 100644
--- a/tools/llvm-objcopy/Object.h
+++ b/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 <class T>
- 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/tools/llvm-objcopy/llvm-objcopy.cpp b/tools/llvm-objcopy/llvm-objcopy.cpp
index 9fc2897959c..7f55a434b33 100644
--- a/tools/llvm-objcopy/llvm-objcopy.cpp
+++ b/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/tools/llvm-objcopy/llvm-objcopy.h b/tools/llvm-objcopy/llvm-objcopy.h
index d30b43a46a4..de7bf367ac8 100644
--- a/tools/llvm-objcopy/llvm-objcopy.h
+++ b/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)