blob: 8f0035cfd8e68806abbe4fafa947a5ef88ebda61 [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===-- RegionPrinter.h - Region printer external interface -----*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines external functions that can be called to explicitly
11// instantiate the region printer.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_ANALYSIS_REGIONPRINTER_H
16#define LLVM_ANALYSIS_REGIONPRINTER_H
17
18namespace llvm {
19 class FunctionPass;
20 class Function;
21 class RegionInfo;
22
23 FunctionPass *createRegionViewerPass();
24 FunctionPass *createRegionOnlyViewerPass();
25 FunctionPass *createRegionPrinterPass();
26 FunctionPass *createRegionOnlyPrinterPass();
27
28#ifndef NDEBUG
29 /// @brief Open a viewer to display the GraphViz vizualization of the analysis
30 /// result.
31 ///
32 /// Practical to call in the debugger.
33 /// Includes the instructions in each BasicBlock.
34 ///
35 /// @param RI The analysis to display.
36 void viewRegion(llvm::RegionInfo *RI);
37
38 /// @brief Analyze the regions of a function and open its GraphViz
39 /// visualization in a viewer.
40 ///
41 /// Useful to call in the debugger.
42 /// Includes the instructions in each BasicBlock.
43 /// The result of a new analysis may differ from the RegionInfo the pass
44 /// manager currently holds.
45 ///
46 /// @param F Function to analyze.
47 void viewRegion(const llvm::Function *F);
48
49 /// @brief Open a viewer to display the GraphViz vizualization of the analysis
50 /// result.
51 ///
52 /// Useful to call in the debugger.
53 /// Shows only the BasicBlock names without their instructions.
54 ///
55 /// @param RI The analysis to display.
56 void viewRegionOnly(llvm::RegionInfo *RI);
57
58 /// @brief Analyze the regions of a function and open its GraphViz
59 /// visualization in a viewer.
60 ///
61 /// Useful to call in the debugger.
62 /// Shows only the BasicBlock names without their instructions.
63 /// The result of a new analysis may differ from the RegionInfo the pass
64 /// manager currently holds.
65 ///
66 /// @param F Function to analyze.
67 void viewRegionOnly(const llvm::Function *F);
68#endif
69} // End llvm namespace
70
71#endif