From 63d48e5956755f4565a266e162ef5aa70dc30957 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 27 Apr 2017 04:01:14 +0000 Subject: [PATCH] Remove needless type conversions. llvm-svn: 301513 --- lld/ELF/InputFiles.cpp | 8 ++++---- lld/ELF/Writer.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index b5c3054..b032dc8 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -748,7 +748,7 @@ template void SharedFile::parseRest() { // with explicit versions. if (V) { StringRef VerName = this->StringTable.data() + V->getAux()->vda_name; - Name = Saver.save(Twine(Name) + "@" + VerName); + Name = Saver.save(Name + "@" + VerName); elf::Symtab::X->addShared(this, Name, Sym, V); } } @@ -891,9 +891,9 @@ template void BinaryFile::parse() { std::transform(Filename.begin(), Filename.end(), Filename.begin(), [](char C) { return isalnum(C) ? C : '_'; }); Filename = "_binary_" + Filename; - StringRef StartName = Saver.save(Twine(Filename) + "_start"); - StringRef EndName = Saver.save(Twine(Filename) + "_end"); - StringRef SizeName = Saver.save(Twine(Filename) + "_size"); + StringRef StartName = Saver.save(Filename + "_start"); + StringRef EndName = Saver.save(Filename + "_end"); + StringRef SizeName = Saver.save(Filename + "_size"); auto *Section = make(SHF_ALLOC | SHF_WRITE, SHT_PROGBITS, 8, Data, ".data"); diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 989a55a..f4d41eb 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -101,7 +101,7 @@ StringRef elf::getOutputSectionName(StringRef Name) { for (StringRef V : {".rel.", ".rela."}) { if (Name.startswith(V)) { StringRef Inner = getOutputSectionName(Name.substr(V.size() - 1)); - return Saver.save(Twine(V.drop_back()) + Inner); + return Saver.save(V.drop_back() + Inner); } } } @@ -123,7 +123,7 @@ StringRef elf::getOutputSectionName(StringRef Name) { // ".zdebug_" is a prefix for ZLIB-compressed sections. // Because we decompressed input sections, we want to remove 'z'. if (Name.startswith(".zdebug_")) - return Saver.save(Twine(".") + Name.substr(2)); + return Saver.save("." + Name.substr(2)); return Name; } -- 2.7.4