summaryrefslogtreecommitdiff
path: root/tools/opt/PassRegistry.def
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-04-21 08:08:50 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-04-21 08:08:50 +0000
commita21cd0433e7cde887b061ecac08c0de9f1cb8cb9 (patch)
treee52466127e7fea7494a1a4798e7cf4e3f1381708 /tools/opt/PassRegistry.def
parent81549a0a3907f7e49f4f49bdfdadc313cf61025a (diff)
downloadllvm-a21cd0433e7cde887b061ecac08c0de9f1cb8cb9.tar.gz
llvm-a21cd0433e7cde887b061ecac08c0de9f1cb8cb9.tar.bz2
llvm-a21cd0433e7cde887b061ecac08c0de9f1cb8cb9.tar.xz
[PM] Add a nice low-tech registry of passes as a boring macro expansion
file. This will make it easy to scale up the number of passes supported. Currently, it just supports the function and module transformation passes that were already supported in the opt tool explicitly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt/PassRegistry.def')
-rw-r--r--tools/opt/PassRegistry.def30
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/opt/PassRegistry.def b/tools/opt/PassRegistry.def
new file mode 100644
index 0000000000..6b507f7755
--- /dev/null
+++ b/tools/opt/PassRegistry.def
@@ -0,0 +1,30 @@
+//===- PassRegistry.def - Registry of passes --------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is used as the registry of passes that are part of the core LLVM
+// libraries. This file describes both transformation passes and analyses
+// Analyses are registered while transformation passes have names registered
+// that can be used when providing a textual pass pipeline.
+//
+//===----------------------------------------------------------------------===//
+
+// NOTE: NO INCLUDE GUARD DESIRED!
+
+#ifndef MODULE_PASS
+#define MODULE_PASS(NAME, CREATE_PASS)
+#endif
+MODULE_PASS("print", PrintModulePass(dbgs()))
+MODULE_PASS("print-cg", LazyCallGraphPrinterPass(dbgs()))
+#undef MODULE_PASS
+
+#ifndef FUNCTION_PASS
+#define FUNCTION_PASS(NAME, CREATE_PASS)
+#endif
+FUNCTION_PASS("print", PrintFunctionPass(dbgs()))
+#undef FUNCTION_PASS