aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2008-11-17 17:30:25 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2008-11-17 17:30:25 +0000
commit35fde150591d7c5f032a5e7c9643315e5f2bedde (patch)
tree0fe26a6f8a9013fba98fe980595413fce6e3b405 /include/llvm
parentfa2707709d8edb493e33fdeca5710011ec309728 (diff)
downloadexternal_llvm-35fde150591d7c5f032a5e7c9643315e5f2bedde.zip
external_llvm-35fde150591d7c5f032a5e7c9643315e5f2bedde.tar.gz
external_llvm-35fde150591d7c5f032a5e7c9643315e5f2bedde.tar.bz2
Support dependencies between plugins by priority-sorting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59449 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/CompilerDriver/Common.td5
-rw-r--r--include/llvm/CompilerDriver/Plugin.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/CompilerDriver/Common.td b/include/llvm/CompilerDriver/Common.td
index e017326..4589f91 100644
--- a/include/llvm/CompilerDriver/Common.td
+++ b/include/llvm/CompilerDriver/Common.td
@@ -65,6 +65,11 @@ def or;
def inc_weight;
def dec_weight;
+// Used to specify plugin priority.
+class PluginPriority<int p> {
+ int priority = p;
+}
+
// Option list - used to specify aliases and sometimes help strings.
class OptionList<list<dag> l> {
list<dag> options = l;
diff --git a/include/llvm/CompilerDriver/Plugin.h b/include/llvm/CompilerDriver/Plugin.h
index 1dc0df9..5426ac7 100644
--- a/include/llvm/CompilerDriver/Plugin.h
+++ b/include/llvm/CompilerDriver/Plugin.h
@@ -24,6 +24,11 @@ namespace llvmc {
/// BasePlugin - An abstract base class for all LLVMC plugins.
struct BasePlugin {
+ /// Priority - Plugin priority, useful for handling dependencies
+ /// between plugins. Plugins with lower priorities are loaded
+ /// first.
+ virtual int Priority() 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;