Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:16

0001 //===-- RegionPrinter.h - Region printer external interface -----*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file defines external functions that can be called to explicitly
0010 // instantiate the region printer.
0011 //
0012 //===----------------------------------------------------------------------===//
0013 
0014 #ifndef LLVM_ANALYSIS_REGIONPRINTER_H
0015 #define LLVM_ANALYSIS_REGIONPRINTER_H
0016 
0017 #include "llvm/Support/DOTGraphTraits.h"
0018 
0019 namespace llvm {
0020   class FunctionPass;
0021   class Function;
0022   class RegionInfo;
0023   class RegionNode;
0024 
0025   FunctionPass *createRegionViewerPass();
0026   FunctionPass *createRegionOnlyViewerPass();
0027   FunctionPass *createRegionPrinterPass();
0028   FunctionPass *createRegionOnlyPrinterPass();
0029 
0030   template <>
0031   struct DOTGraphTraits<RegionNode *> : public DefaultDOTGraphTraits {
0032     DOTGraphTraits(bool isSimple = false) : DefaultDOTGraphTraits(isSimple) {}
0033 
0034     std::string getNodeLabel(RegionNode *Node, RegionNode *Graph);
0035   };
0036 
0037 #ifndef NDEBUG
0038   /// Open a viewer to display the GraphViz vizualization of the analysis
0039   /// result.
0040   ///
0041   /// Practical to call in the debugger.
0042   /// Includes the instructions in each BasicBlock.
0043   ///
0044   /// @param RI The analysis to display.
0045   void viewRegion(llvm::RegionInfo *RI);
0046 
0047   /// Analyze the regions of a function and open its GraphViz
0048   /// visualization in a viewer.
0049   ///
0050   /// Useful to call in the debugger.
0051   /// Includes the instructions in each BasicBlock.
0052   /// The result of a new analysis may differ from the RegionInfo the pass
0053   /// manager currently holds.
0054   ///
0055   /// @param F Function to analyze.
0056   void viewRegion(const llvm::Function *F);
0057 
0058   /// Open a viewer to display the GraphViz vizualization of the analysis
0059   /// result.
0060   ///
0061   /// Useful to call in the debugger.
0062   /// Shows only the BasicBlock names without their instructions.
0063   ///
0064   /// @param RI The analysis to display.
0065   void viewRegionOnly(llvm::RegionInfo *RI);
0066 
0067   /// Analyze the regions of a function and open its GraphViz
0068   /// visualization in a viewer.
0069   ///
0070   /// Useful to call in the debugger.
0071   /// Shows only the BasicBlock names without their instructions.
0072   /// The result of a new analysis may differ from the RegionInfo the pass
0073   /// manager currently holds.
0074   ///
0075   /// @param F Function to analyze.
0076   void viewRegionOnly(const llvm::Function *F);
0077 #endif
0078 } // End llvm namespace
0079 
0080 #endif