From f084b2164462e8d63ccc1c9cf1b15f4b0abb339a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 6 Jul 2001 16:57:52 +0000 Subject: [PATCH] New file, includes method to merge exit nodes together llvm-svn: 141 --- include/llvm/Analysis/SimplifyCFG.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 include/llvm/Analysis/SimplifyCFG.h diff --git a/include/llvm/Analysis/SimplifyCFG.h b/include/llvm/Analysis/SimplifyCFG.h new file mode 100644 index 00000000000..062d16a2de6 --- /dev/null +++ b/include/llvm/Analysis/SimplifyCFG.h @@ -0,0 +1,27 @@ +//===- llvm/Analysis/SimplifyCFG.h - CFG Simplification XForms ---*- C++ -*--=// +// +// This file provides several routines that are useful for simplifying CFGs in +// various ways... +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ANALYSIS_SIMPLIFY_CFG_H +#define LLVM_ANALYSIS_SIMPLIFY_CFG_H + +class BasicBlock; +class Method; + +namespace cfg { + + // UnifyAllExitNodes - Unify all exit nodes of the CFG by creating a new + // BasicBlock, and converting all returns to unconditional branches to this + // new basic block. The singular exit node is returned. + // + // If there are no return stmts in the Method, a null pointer is returned. + // + BasicBlock *UnifyAllExitNodes(Method *M); + +} // End Namespace cfg + + +#endif