LLVM  11.0.0git
Functions | Variables
CFGPrinter.cpp File Reference
#include "llvm/Analysis/CFGPrinter.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
#include <algorithm>
Include dependency graph for CFGPrinter.cpp:

Go to the source code of this file.

Functions

static void writeCFGToDotFile (Function &F, BlockFrequencyInfo *BFI, BranchProbabilityInfo *BPI, uint64_t MaxFreq, bool CFGOnly=false)
 
static void viewCFG (Function &F, const BlockFrequencyInfo *BFI, const BranchProbabilityInfo *BPI, uint64_t MaxFreq, bool CFGOnly=false)
 
 INITIALIZE_PASS (CFGViewerLegacyPass, "view-cfg", "View CFG of function", false, true) PreservedAnalyses CFGViewerPass
 
 INITIALIZE_PASS (CFGOnlyViewerLegacyPass, "view-cfg-only", "View CFG of function (with no function bodies)", false, true) PreservedAnalyses CFGOnlyViewerPass
 
 INITIALIZE_PASS (CFGPrinterLegacyPass, "dot-cfg", "Print CFG of function to 'dot' file", false, true) PreservedAnalyses CFGPrinterPass
 
 INITIALIZE_PASS (CFGOnlyPrinterLegacyPass, "dot-cfg-only", "Print CFG of function to 'dot' file (with no function bodies)", false, true) PreservedAnalyses CFGOnlyPrinterPass
 

Variables

static cl::opt< std::string > CFGFuncName ("cfg-func-name", cl::Hidden, cl::desc("The name of a function (or its substring)" " whose CFG is viewed/printed."))
 
static cl::opt< std::string > CFGDotFilenamePrefix ("cfg-dot-filename-prefix", cl::Hidden, cl::desc("The prefix used for the CFG dot file names."))
 
static cl::opt< boolHideUnreachablePaths ("cfg-hide-unreachable-paths", cl::init(false))
 
static cl::opt< boolHideDeoptimizePaths ("cfg-hide-deoptimize-paths", cl::init(false))
 
static cl::opt< boolShowHeatColors ("cfg-heat-colors", cl::init(true), cl::Hidden, cl::desc("Show heat colors in CFG"))
 
static cl::opt< boolUseRawEdgeWeight ("cfg-raw-weights", cl::init(false), cl::Hidden, cl::desc("Use raw weights for labels. " "Use percentages as default."))
 
static cl::opt< boolShowEdgeWeight ("cfg-weights", cl::init(false), cl::Hidden, cl::desc("Show edges labeled with weights"))
 

Function Documentation

◆ INITIALIZE_PASS() [1/4]

INITIALIZE_PASS ( CFGViewerLegacyPass  ,
"view-cfg"  ,
"View CFG of function ,
false  ,
true   
)

◆ INITIALIZE_PASS() [2/4]

INITIALIZE_PASS ( CFGOnlyViewerLegacyPass  ,
"view-cfg-only ,
"View CFG of function (with no function bodies)"  ,
false  ,
true   
)

◆ INITIALIZE_PASS() [3/4]

INITIALIZE_PASS ( CFGPrinterLegacyPass  ,
"dot-cfg"  ,
"Print CFG of function to 'dot' file ,
false  ,
true   
)

◆ INITIALIZE_PASS() [4/4]

INITIALIZE_PASS ( CFGOnlyPrinterLegacyPass  ,
"dot-cfg-only ,
"Print CFG of function to 'dot' file (with no function bodies)"  ,
false  ,
true   
)

◆ viewCFG()

static void viewCFG ( Function F,
const BlockFrequencyInfo BFI,
const BranchProbabilityInfo BPI,
uint64_t  MaxFreq,
bool  CFGOnly = false 
)
static

◆ writeCFGToDotFile()

static void writeCFGToDotFile ( Function F,
BlockFrequencyInfo BFI,
BranchProbabilityInfo BPI,
uint64_t  MaxFreq,
bool  CFGOnly = false 
)
static

Variable Documentation

◆ CFGDotFilenamePrefix

cl::opt<std::string> CFGDotFilenamePrefix("cfg-dot-filename-prefix", cl::Hidden, cl::desc("The prefix used for the CFG dot file names."))
static

Referenced by writeCFGToDotFile().

◆ CFGFuncName

cl::opt<std::string> CFGFuncName("cfg-func-name", cl::Hidden, cl::desc("The name of a function (or its substring)" " whose CFG is viewed/printed."))
static

Referenced by llvm::Function::viewCFG().

◆ HideDeoptimizePaths

cl::opt<bool> HideDeoptimizePaths("cfg-hide-deoptimize-paths", cl::init(false))
static

◆ HideUnreachablePaths

cl::opt<bool> HideUnreachablePaths("cfg-hide-unreachable-paths", cl::init(false))
static

◆ ShowEdgeWeight

cl::opt<bool> ShowEdgeWeight("cfg-weights", cl::init(false), cl::Hidden, cl::desc("Show edges labeled with weights"))
static

Referenced by viewCFG(), and writeCFGToDotFile().

◆ ShowHeatColors

cl::opt<bool> ShowHeatColors("cfg-heat-colors", cl::init(true), cl::Hidden, cl::desc("Show heat colors in CFG"))
static

Referenced by viewCFG(), and writeCFGToDotFile().

◆ UseRawEdgeWeight

cl::opt<bool> UseRawEdgeWeight("cfg-raw-weights", cl::init(false), cl::Hidden, cl::desc("Use raw weights for labels. " "Use percentages as default."))
static

Referenced by viewCFG(), and writeCFGToDotFile().