Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 1 | //===-- RegionPrinter.h - Region printer external interface -----*- C++ -*-===// |
| 2 | // |
Andrew Walbran | 16937d0 | 2019-10-22 13:54:20 +0100 | [diff] [blame] | 3 | // 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 Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 6 | // |
| 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 | |
| 17 | namespace 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 Scull | cdfcccc | 2018-10-05 20:58:37 +0100 | [diff] [blame] | 28 | /// Open a viewer to display the GraphViz vizualization of the analysis |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 29 | /// 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 Scull | cdfcccc | 2018-10-05 20:58:37 +0100 | [diff] [blame] | 37 | /// Analyze the regions of a function and open its GraphViz |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 38 | /// 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 Scull | cdfcccc | 2018-10-05 20:58:37 +0100 | [diff] [blame] | 48 | /// Open a viewer to display the GraphViz vizualization of the analysis |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 49 | /// 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 Scull | cdfcccc | 2018-10-05 20:58:37 +0100 | [diff] [blame] | 57 | /// Analyze the regions of a function and open its GraphViz |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 58 | /// 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 |