Revert 106592 for now. It causes clang-selfhost build failure.
[oota-llvm.git] / lib / CompilerDriver / Plugin.cpp
index 7310d120bff58169ee325ffd14f525fb6a62903c..0fdfef4c6a29b7044b93d01ceb7ebd590cf926f9 100644 (file)
@@ -62,18 +62,17 @@ namespace llvmc {
     pluginListInitialized = false;
   }
 
-  void PluginLoader::PopulateLanguageMap(LanguageMap& langMap) {
+  void PluginLoader::RunInitialization(LanguageMap& langMap,
+                                       CompilationGraph& graph) const
+  {
     llvm::sys::SmartScopedLock<true> Lock(*PluginMutex);
     for (PluginList::iterator B = Plugins.begin(), E = Plugins.end();
-         B != E; ++B)
-      (*B)->PopulateLanguageMap(langMap);
-  }
-
-  void PluginLoader::PopulateCompilationGraph(CompilationGraph& graph) {
-    llvm::sys::SmartScopedLock<true> Lock(*PluginMutex);
-    for (PluginList::iterator B = Plugins.begin(), E = Plugins.end();
-         B != E; ++B)
-      (*B)->PopulateCompilationGraph(graph);
+         B != E; ++B) {
+      const BasePlugin* BP = *B;
+      BP->PreprocessOptions();
+      BP->PopulateLanguageMap(langMap);
+      BP->PopulateCompilationGraph(graph);
+    }
   }
 
 }