blob: 154ac35c486adb10c04fdbceea72a2d7566c7370 [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===-- RegionPrinter.h - Region printer external interface -----*- C++ -*-===//
2//
Andrew Walbran16937d02019-10-22 13:54:20 +01003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01006//
7//===----------------------------------------------------------------------===//
8//
9// This file defines external functions that can be called to explicitly
10// instantiate the region printer.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_ANALYSIS_REGIONPRINTER_H
15#define LLVM_ANALYSIS_REGIONPRINTER_H
16
17namespace llvm {
18 class FunctionPass;
19 class Function;
20 class RegionInfo;
21
22 FunctionPass *createRegionViewerPass();
23 FunctionPass *createRegionOnlyViewerPass();
24 FunctionPass *createRegionPrinterPass();
25 FunctionPass *createRegionOnlyPrinterPass();
26
27#ifndef NDEBUG
Andrew Scullcdfcccc2018-10-05 20:58:37 +010028 /// Open a viewer to display the GraphViz vizualization of the analysis
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010029 /// result.
30 ///
31 /// Practical to call in the debugger.
32 /// Includes the instructions in each BasicBlock.
33 ///
34 /// @param RI The analysis to display.
35 void viewRegion(llvm::RegionInfo *RI);
36
Andrew Scullcdfcccc2018-10-05 20:58:37 +010037 /// Analyze the regions of a function and open its GraphViz
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010038 /// visualization in a viewer.
39 ///
40 /// Useful to call in the debugger.
41 /// Includes the instructions in each BasicBlock.
42 /// The result of a new analysis may differ from the RegionInfo the pass
43 /// manager currently holds.
44 ///
45 /// @param F Function to analyze.
46 void viewRegion(const llvm::Function *F);
47
Andrew Scullcdfcccc2018-10-05 20:58:37 +010048 /// Open a viewer to display the GraphViz vizualization of the analysis
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010049 /// result.
50 ///
51 /// Useful to call in the debugger.
52 /// Shows only the BasicBlock names without their instructions.
53 ///
54 /// @param RI The analysis to display.
55 void viewRegionOnly(llvm::RegionInfo *RI);
56
Andrew Scullcdfcccc2018-10-05 20:58:37 +010057 /// Analyze the regions of a function and open its GraphViz
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010058 /// visualization in a viewer.
59 ///
60 /// Useful to call in the debugger.
61 /// Shows only the BasicBlock names without their instructions.
62 /// The result of a new analysis may differ from the RegionInfo the pass
63 /// manager currently holds.
64 ///
65 /// @param F Function to analyze.
66 void viewRegionOnly(const llvm::Function *F);
67#endif
68} // End llvm namespace
69
70#endif