forked from OSchip/llvm-project
[lld] Clean up in lld::{coff,elf}::link after D70378
Library users should not need to call errorHandler().reset() explicitly.
google/iree calls lld:🧝:link and without the patch some global
variables are not cleaned up in the next invocation.
This commit is contained in:
parent
92106641ae
commit
1ca6bd261e
|
@ -96,7 +96,10 @@ bool link(ArrayRef<const char *> args, bool canExitEarly, raw_ostream &stdoutOS,
|
|||
if (canExitEarly)
|
||||
exitLld(errorCount() ? 1 : 0);
|
||||
|
||||
return !errorCount();
|
||||
bool ret = errorCount() == 0;
|
||||
if (!canExitEarly)
|
||||
errorHandler().reset();
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Parse options of the form "old;new".
|
||||
|
|
|
@ -125,7 +125,10 @@ bool elf::link(ArrayRef<const char *> args, bool canExitEarly,
|
|||
if (canExitEarly)
|
||||
exitLld(errorCount() ? 1 : 0);
|
||||
|
||||
return !errorCount();
|
||||
bool ret = errorCount() == 0;
|
||||
if (!canExitEarly)
|
||||
errorHandler().reset();
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Parses a linker -m option.
|
||||
|
|
Loading…
Reference in New Issue