summaryrefslogtreecommitdiff
path: root/include/llvm/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
commit0a22fb66644c3b28836387917e15091573c068b9 (patch)
treeb40991888d39def7f349efbe24ef8fdf41454b73 /include/llvm/CompilerDriver
parent5a1a53e4508a479e18fe69798909d3d7fa63ad5e (diff)
downloadllvm-0a22fb66644c3b28836387917e15091573c068b9.tar.gz
llvm-0a22fb66644c3b28836387917e15091573c068b9.tar.bz2
llvm-0a22fb66644c3b28836387917e15091573c068b9.tar.xz
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 'include/llvm/CompilerDriver')
-rw-r--r--include/llvm/CompilerDriver/Common.td11
-rw-r--r--include/llvm/CompilerDriver/Plugin.h16
2 files changed, 19 insertions, 8 deletions
diff --git a/include/llvm/CompilerDriver/Common.td b/include/llvm/CompilerDriver/Common.td
index 5b7c543f1c..bffab59f3a 100644
--- a/include/llvm/CompilerDriver/Common.td
+++ b/include/llvm/CompilerDriver/Common.td
@@ -68,6 +68,8 @@ def not_empty;
def default;
def single_input_file;
def multiple_input_files;
+def any_switch_on;
+def any_not_empty;
// Possible actions.
@@ -76,7 +78,9 @@ def forward;
def forward_as;
def stop_compilation;
def unpack_values;
+def warning;
def error;
+def unset_option;
// Increase/decrease the edge weight.
def inc_weight;
@@ -90,11 +94,16 @@ class PluginPriority<int p> {
int priority = p;
}
-// Option list - used to specify aliases and sometimes help strings.
+// Option list - a single place to specify options.
class OptionList<list<dag> l> {
list<dag> options = l;
}
+// Option preprocessor - actions taken during plugin loading.
+class OptionPreprocessor<dag d> {
+ dag preprocessor = d;
+}
+
// Map from suffixes to language names
class LangToSuffixes<string str, list<string> lst> {
diff --git a/include/llvm/CompilerDriver/Plugin.h b/include/llvm/CompilerDriver/Plugin.h
index 9f9eee3c0d..e9a20488a0 100644
--- a/include/llvm/CompilerDriver/Plugin.h
+++ b/include/llvm/CompilerDriver/Plugin.h
@@ -29,6 +29,11 @@ namespace llvmc {
/// first.
virtual int Priority() const { return 0; }
+ /// PreprocessOptions - The auto-generated function that performs various
+ /// consistency checks on options (like ensuring that -O2 and -O3 are not
+ /// used together).
+ virtual void PreprocessOptions() const = 0;
+
/// PopulateLanguageMap - The auto-generated function that fills in
/// the language map (map from file extensions to language names).
virtual void PopulateLanguageMap(LanguageMap&) const = 0;
@@ -60,13 +65,10 @@ namespace llvmc {
PluginLoader();
~PluginLoader();
- /// PopulateLanguageMap - Fills in the language map by calling
- /// PopulateLanguageMap methods of all plugins.
- void PopulateLanguageMap(LanguageMap& langMap);
-
- /// PopulateCompilationGraph - Populates the compilation graph by
- /// calling PopulateCompilationGraph methods of all plugins.
- void PopulateCompilationGraph(CompilationGraph& tools);
+ /// RunInitialization - Calls PreprocessOptions, PopulateLanguageMap and
+ /// PopulateCompilationGraph methods of all plugins. This populates the
+ /// global language map and the compilation graph.
+ void RunInitialization(LanguageMap& langMap, CompilationGraph& graph) const;
private:
// noncopyable