parent
67ab269e1d
commit
332fc712c6
|
|
@ -113,7 +113,7 @@ struct Configuration {
|
|||
std::vector<llvm::StringRef> argv;
|
||||
|
||||
// Symbols in this set are considered as live by the garbage collector.
|
||||
std::vector<Symbol *> gCRoot;
|
||||
std::vector<Symbol *> gcroot;
|
||||
|
||||
std::set<std::string> noDefaultLibs;
|
||||
bool noDefaultLibAll = false;
|
||||
|
|
|
|||
|
|
@ -497,7 +497,7 @@ Symbol *LinkerDriver::addUndefined(StringRef name) {
|
|||
Symbol *b = symtab->addUndefined(name);
|
||||
if (!b->isGCRoot) {
|
||||
b->isGCRoot = true;
|
||||
config->gCRoot.push_back(b);
|
||||
config->gcroot.push_back(b);
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -832,7 +832,7 @@ void BitcodeFile::parse() {
|
|||
}
|
||||
symbols.push_back(sym);
|
||||
if (objSym.isUsed())
|
||||
config->gCRoot.push_back(sym);
|
||||
config->gcroot.push_back(sym);
|
||||
}
|
||||
directives = obj->getCOFFLinkerOpts();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@
|
|||
namespace lld {
|
||||
namespace coff {
|
||||
|
||||
static Timer gCTimer("GC", Timer::root());
|
||||
static Timer gctimer("GC", Timer::root());
|
||||
|
||||
// Set live bit on for each reachable chunk. Unmarked (unreachable)
|
||||
// COMDAT chunks will be ignored by Writer, so they will be excluded
|
||||
// from the final output.
|
||||
void markLive(ArrayRef<Chunk *> chunks) {
|
||||
ScopedTimer t(gCTimer);
|
||||
ScopedTimer t(gctimer);
|
||||
|
||||
// We build up a worklist of sections which have been marked as live. We only
|
||||
// push into the worklist when we discover an unmarked section, and we mark
|
||||
|
|
@ -51,7 +51,7 @@ void markLive(ArrayRef<Chunk *> chunks) {
|
|||
};
|
||||
|
||||
// Add GC root chunks.
|
||||
for (Symbol *b : config->gCRoot)
|
||||
for (Symbol *b : config->gcroot)
|
||||
addSym(b);
|
||||
|
||||
while (!worklist.empty()) {
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ void SymbolTable::reportRemainingUndefines() {
|
|||
if (undefs.empty() && localImports.empty())
|
||||
return;
|
||||
|
||||
for (Symbol *b : config->gCRoot) {
|
||||
for (Symbol *b : config->gcroot) {
|
||||
if (undefs.count(b))
|
||||
errorOrWarn("<root>: undefined symbol: " + toString(*b));
|
||||
if (config->warnLocallyDefinedImported)
|
||||
|
|
|
|||
Loading…
Reference in New Issue