Skip to content

Commit 59bc03c

Browse files
committed
[lld-link] Simplify warnUnusable. NFC
1 parent 1534f45 commit 59bc03c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lld/COFF/PDB.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,11 +1006,10 @@ static void warnUnusable(InputFile *f, Error e, bool shouldWarn) {
10061006
consumeError(std::move(e));
10071007
return;
10081008
}
1009-
auto msg = "Cannot use debug info for '" + toString(f) + "' [LNK4099]";
1009+
auto diag = Warn(f->ctx);
1010+
diag << "Cannot use debug info for '" << f << "' [LNK4099]";
10101011
if (e)
1011-
warn(msg + "\n>>> failed to load reference " + toString(std::move(e)));
1012-
else
1013-
warn(msg);
1012+
diag << "\n>>> failed to load reference " << std::move(e);
10141013
}
10151014

10161015
// Allocate memory for a .debug$S / .debug$F section and relocate it.

0 commit comments

Comments
 (0)