[mac/lld] Implement -t

Goes well with `-why_load` to get an idea of load order.

Differential Revision: https://reviews.llvm.org/D92583
This commit is contained in:
Nico Weber
2020-12-02 18:57:30 -05:00
parent 4fff2a7e89
commit 7cb0a373d1
7 changed files with 70 additions and 13 deletions

View File

@@ -187,9 +187,9 @@ uint32_t macho::getModTime(StringRef path) {
return 0;
}
void macho::printWhyLoad(StringRef reason, const InputFile *f) {
if (!config->printWhyLoad)
return;
lld::outs() << reason << " forced load of " << toString(f)
<< '\n';
void macho::printArchiveMemberLoad(StringRef reason, const InputFile *f) {
if (config->printEachFile)
lld::outs() << toString(f) << '\n';
if (config->printWhyLoad)
lld::outs() << reason << " forced load of " << toString(f) << '\n';
}