summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-10-12 15:49:06 +0000
committerRui Ueyama <ruiu@google.com>2015-10-12 15:49:06 +0000
commit1c42afcbdce1421aab216ab48e9bdac73c1f1a0b (patch)
treedacbd107a05174948db8d98c9f1b5ba8e041fecd
parent361d8b9350bb9fc2708df67f3543781ddccbec43 (diff)
downloadbcm5719-llvm-1c42afcbdce1421aab216ab48e9bdac73c1f1a0b.tar.gz
bcm5719-llvm-1c42afcbdce1421aab216ab48e9bdac73c1f1a0b.zip
Remove explicit Twine instantiation if possible.
llvm-svn: 250055
-rw-r--r--lld/ELF/Driver.cpp2
-rw-r--r--lld/ELF/InputFiles.cpp10
-rw-r--r--lld/ELF/LinkerScript.cpp2
-rw-r--r--lld/ELF/Target.cpp10
4 files changed, 11 insertions, 13 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index b9f55613f55..28a3e6d28d4 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -81,7 +81,7 @@ void LinkerDriver::addFile(StringRef Path) {
if (Config->Verbose)
llvm::outs() << Path << "\n";
auto MBOrErr = MemoryBuffer::getFile(Path);
- error(MBOrErr, Twine("cannot open ") + Path);
+ error(MBOrErr, "cannot open " + Path);
std::unique_ptr<MemoryBuffer> &MB = *MBOrErr;
MemoryBufferRef MBRef = MB->getMemBufferRef();
OwningMBs.push_back(std::move(MB)); // take MB ownership
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 99c8704a049..009fe417908 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -231,15 +231,14 @@ void ArchiveFile::parse() {
// Returns a buffer pointing to a member file containing a given symbol.
MemoryBufferRef ArchiveFile::getMember(const Archive::Symbol *Sym) {
ErrorOr<Archive::child_iterator> ItOrErr = Sym->getMember();
- error(ItOrErr,
- Twine("Could not get the member for symbol ") + Sym->getName());
+ error(ItOrErr, "Could not get the member for symbol " + Sym->getName());
Archive::child_iterator It = *ItOrErr;
if (!Seen.insert(It->getChildOffset()).second)
return MemoryBufferRef();
ErrorOr<MemoryBufferRef> Ret = It->getMemoryBufferRef();
- error(Ret, Twine("Could not get the buffer for the member defining symbol ") +
+ error(Ret, "Could not get the buffer for the member defining symbol " +
Sym->getName());
return *Ret;
}
@@ -250,9 +249,8 @@ std::vector<MemoryBufferRef> ArchiveFile::getMembers() {
std::vector<MemoryBufferRef> Result;
for (const Archive::Child &Child : File->children()) {
ErrorOr<MemoryBufferRef> MbOrErr = Child.getMemoryBufferRef();
- error(MbOrErr,
- Twine("Could not get the buffer for a child of the archive ") +
- File->getFileName());
+ error(MbOrErr, "Could not get the buffer for a child of the archive " +
+ File->getFileName());
Result.push_back(MbOrErr.get());
}
return Result;
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 933b6becb32..f255da3527f 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -192,7 +192,7 @@ void LinkerScript::readGroup() {
void LinkerScript::readInclude() {
StringRef Tok = next();
auto MBOrErr = MemoryBuffer::getFile(Tok);
- error(MBOrErr, Twine("cannot open ") + Tok);
+ error(MBOrErr, "cannot open " + Tok);
std::unique_ptr<MemoryBuffer> &MB = *MBOrErr;
StringRef S = Saver.save(MB->getMemBufferRef().getBuffer());
std::vector<StringRef> V = tokenize(S);
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index 4be867a71d5..d77c0c5170d 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -82,7 +82,7 @@ void X86TargetInfo::relocateOne(uint8_t *Buf, const void *RelP, uint32_t Type,
add32le(Loc, SymVA);
break;
default:
- error(Twine("unrecognized reloc ") + Twine(Type));
+ error("unrecognized reloc " + Twine(Type));
break;
}
}
@@ -193,7 +193,7 @@ void X86_64TargetInfo::relocateOne(uint8_t *Buf, const void *RelP,
break;
}
default:
- error(Twine("unrecognized reloc ") + Twine(Type));
+ error("unrecognized reloc " + Twine(Type));
break;
}
}
@@ -228,7 +228,7 @@ void PPC64TargetInfo::relocateOne(uint8_t *Buf, const void *RelP, uint32_t Type,
// We don't create a TOC yet.
break;
default:
- error(Twine("unrecognized reloc ") + Twine(Type));
+ error("unrecognized reloc " + Twine(Type));
break;
}
}
@@ -340,7 +340,7 @@ void AArch64TargetInfo::relocateOne(uint8_t *Buf, const void *RelP,
break;
}
default:
- error(Twine("unrecognized reloc ") + Twine(Type));
+ error("unrecognized reloc " + Twine(Type));
break;
}
}
@@ -373,7 +373,7 @@ void MipsTargetInfo::relocateOne(uint8_t *Buf, const void *RelP, uint32_t Type,
add32le(Buf + Rel.r_offset, SymVA);
break;
default:
- error(Twine("unrecognized reloc ") + Twine(Type));
+ error("unrecognized reloc " + Twine(Type));
break;
}
}
OpenPOWER on IntegriCloud