Skip to content

Commit 6c19fa4

Browse files
committed
[ELF] Remove unneeded toString(Error) when using ELFSyncStream
1 parent 38870fe commit 6c19fa4

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

lld/ELF/Arch/RISCV.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,8 +1063,7 @@ static void mergeArch(Ctx &ctx, RISCVISAUtils::OrderedExtensionMap &mergedExts,
10631063
StringRef s) {
10641064
auto maybeInfo = RISCVISAInfo::parseNormalizedArchString(s);
10651065
if (!maybeInfo) {
1066-
Err(ctx) << sec << ": " << s << ": "
1067-
<< maybeInfo.takeError();
1066+
Err(ctx) << sec << ": " << s << ": " << maybeInfo.takeError();
10681067
return;
10691068
}
10701069

lld/ELF/Driver.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,8 +1140,7 @@ static void ltoValidateAllVtablesHaveTypeInfos(Ctx &ctx,
11401140
<< knownSafeName;
11411141
Expected<GlobPattern> pat = GlobPattern::create(knownSafeName);
11421142
if (!pat)
1143-
ErrAlways(ctx) << "--lto-known-safe-vtables=: "
1144-
<< pat.takeError();
1143+
ErrAlways(ctx) << "--lto-known-safe-vtables=: " << pat.takeError();
11451144
vtableSymbolsWithNoRTTI.remove_if(
11461145
[&](StringRef s) { return pat->match(s); });
11471146
}
@@ -1271,8 +1270,7 @@ static bool remapInputs(Ctx &ctx, StringRef line, const Twine &location) {
12711270
else if (Expected<GlobPattern> pat = GlobPattern::create(fields[0]))
12721271
ctx.arg.remapInputsWildcards.emplace_back(std::move(*pat), fields[1]);
12731272
else {
1274-
ErrAlways(ctx) << location << ": " << pat.takeError() << ": "
1275-
<< fields[0];
1273+
ErrAlways(ctx) << location << ": " << pat.takeError() << ": " << fields[0];
12761274
return true;
12771275
}
12781276
return false;
@@ -1600,8 +1598,7 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
16001598
else if (Expected<GlobPattern> pat = GlobPattern::create(kv.first))
16011599
ctx.arg.shuffleSections.emplace_back(std::move(*pat), uint32_t(v));
16021600
else
1603-
ErrAlways(ctx) << errPrefix << pat.takeError() << ": "
1604-
<< kv.first;
1601+
ErrAlways(ctx) << errPrefix << pat.takeError() << ": " << kv.first;
16051602
}
16061603

16071604
auto reports = {std::make_pair("bti-report", &ctx.arg.zBtiReport),

lld/ELF/InputSection.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ static void decompressAux(Ctx &ctx, const InputSectionBase &sec, uint8_t *out,
121121
if (Error e = hdr->ch_type == ELFCOMPRESS_ZLIB
122122
? compression::zlib::decompress(compressed, out, size)
123123
: compression::zstd::decompress(compressed, out, size))
124-
Fatal(ctx) << &sec
125-
<< ": decompress failed: " << std::move(e);
124+
Fatal(ctx) << &sec << ": decompress failed: " << std::move(e);
126125
}
127126

128127
void InputSectionBase::decompress() const {
@@ -1278,8 +1277,7 @@ template <class ELFT> void InputSection::writeTo(Ctx &ctx, uint8_t *buf) {
12781277
if (Error e = hdr->ch_type == ELFCOMPRESS_ZLIB
12791278
? compression::zlib::decompress(compressed, buf, size)
12801279
: compression::zstd::decompress(compressed, buf, size))
1281-
Fatal(ctx) << this
1282-
<< ": decompress failed: " << llvm::toString(std::move(e));
1280+
Fatal(ctx) << this << ": decompress failed: " << std::move(e);
12831281
uint8_t *bufEnd = buf + size;
12841282
relocate<ELFT>(ctx, buf, bufEnd);
12851283
return;

0 commit comments

Comments
 (0)