Change ModuleLinker to take a set of GlobalValues to import instead of a single one
[oota-llvm.git] / lib / Transforms / IPO / FunctionImport.cpp
index 92764c9e8c3fc70c4e98b728739ff080363e7f47..8230d64026c2dc4d809fdf56728336e4d10f6d42 100644 (file)
@@ -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;
 }