aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CompilerDriver
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2009-10-17 20:09:29 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2009-10-17 20:09:29 +0000
commit6d43539e07cc1a865b4f54bedbd0b374e04963a4 (patch)
treeb40991888d39def7f349efbe24ef8fdf41454b73 /lib/CompilerDriver
parentc53d225e9d93e78dd5ae9f8ee7b6e5fc0bec3e56 (diff)
downloadexternal_llvm-6d43539e07cc1a865b4f54bedbd0b374e04963a4.zip
external_llvm-6d43539e07cc1a865b4f54bedbd0b374e04963a4.tar.gz
external_llvm-6d43539e07cc1a865b4f54bedbd0b374e04963a4.tar.bz2
First draft of the OptionPreprocessor.
More to follow... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84352 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CompilerDriver')
-rw-r--r--lib/CompilerDriver/Main.cpp3
-rw-r--r--lib/CompilerDriver/Plugin.cpp19
2 files changed, 10 insertions, 12 deletions
diff --git a/lib/CompilerDriver/Main.cpp b/lib/CompilerDriver/Main.cpp
index 3e1fc9f..c581809 100644
--- a/lib/CompilerDriver/Main.cpp
+++ b/lib/CompilerDriver/Main.cpp
@@ -95,8 +95,7 @@ int Main(int argc, char** argv) {
(argc, argv, "LLVM Compiler Driver (Work In Progress)", true);
PluginLoader Plugins;
- Plugins.PopulateLanguageMap(langMap);
- Plugins.PopulateCompilationGraph(graph);
+ Plugins.RunInitialization(langMap, graph);
if (CheckGraph) {
int ret = graph.Check();
diff --git a/lib/CompilerDriver/Plugin.cpp b/lib/CompilerDriver/Plugin.cpp
index 7310d12..0fdfef4 100644
--- a/lib/CompilerDriver/Plugin.cpp
+++ b/lib/CompilerDriver/Plugin.cpp
@@ -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);
+ }
}
}