From a21cd0433e7cde887b061ecac08c0de9f1cb8cb9 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 21 Apr 2014 08:08:50 +0000 Subject: [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 --- tools/opt/PassRegistry.def | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tools/opt/PassRegistry.def (limited to 'tools/opt/PassRegistry.def') 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 -- cgit v1.2.3