diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2015-12-02 04:34:28 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2015-12-02 04:34:28 +0000 |
commit | ffe2e4aae021964c8d7f83a362c5b51d83e48d56 (patch) | |
tree | be3e013ec28b56c7c7446aa71bc103f894fa10fb /llvm/lib/Transforms | |
parent | 2d91266473dc02a0ceefa0bbb33f9ac642b4334d (diff) | |
download | bcm5719-llvm-ffe2e4aae021964c8d7f83a362c5b51d83e48d56.tar.gz bcm5719-llvm-ffe2e4aae021964c8d7f83a362c5b51d83e48d56.zip |
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
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/IPO/FunctionImport.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp index 92764c9e8c3..8230d64026c 100644 --- a/llvm/lib/Transforms/IPO/FunctionImport.cpp +++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp @@ -182,7 +182,10 @@ bool FunctionImporter::importFunctions(Module &M) { } // Link in the specified function. - if (L.linkInModule(Module, Linker::Flags::None, &Index, F)) + DenseSet<const GlobalValue *> FunctionsToImport; + FunctionsToImport.insert(F); + if (L.linkInModule(Module, Linker::Flags::None, &Index, + &FunctionsToImport)) report_fatal_error("Function Import: link error"); // Process the newly imported function and add callees to the worklist. @@ -194,6 +197,7 @@ bool FunctionImporter::importFunctions(Module &M) { Changed = true; } + return Changed; } |