Change ModuleLinker to take a set of GlobalValues to import instead of a single one

For efficiency reason, when importing multiple functions for the same Module,
we can avoid reparsing it every time.

Differential Revision: http://reviews.llvm.org/D15102

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 254486
This commit is contained in:
Mehdi Amini
2015-12-02 04:34:28 +00:00
parent 2d91266473
commit ffe2e4aae0
4 changed files with 15 additions and 8 deletions

View File

@@ -198,7 +198,10 @@ static bool importFunctions(const char *argv0, LLVMContext &Context,
}
// Link in the specified function.
if (L.linkInModule(*M, Linker::Flags::None, Index.get(), F))
DenseSet<const GlobalValue *> FunctionToImport;
FunctionToImport.insert(F);
if (L.linkInModule(*M, Linker::Flags::None, Index.get(),
&FunctionToImport))
return false;
}
return true;