15 #ifndef LLVM_ANALYSIS_CFGPRINTER_H
16 #define LLVM_ANALYSIS_CFGPRINTER_H
32 return "CFG for '" + F->
getName().
str() +
"' function";
49 enum { MaxColumns = 80 };
59 std::string OutStr = OS.
str();
60 if (OutStr[0] ==
'\n') OutStr.erase(OutStr.begin());
64 unsigned LastSpace = 0;
65 for (
unsigned i = 0; i != OutStr.length(); ++i) {
66 if (OutStr[i] ==
'\n') {
68 OutStr.insert(OutStr.begin()+i+1,
'l');
71 }
else if (OutStr[i] ==
';') {
72 unsigned Idx = OutStr.find(
'\n', i+1);
73 OutStr.erase(OutStr.begin()+i, OutStr.begin()+Idx);
75 }
else if (ColNum == MaxColumns) {
77 OutStr.insert(LastSpace,
"\\l...");
78 ColNum = i - LastSpace;
95 return getSimpleNodeLabel(Node, Graph);
97 return getCompleteNodeLabel(Node, Graph);
104 if (BI->isConditional())
111 if (SuccNo == 0)
return "def";
ConstantIntTy * getCaseValue()
Resolves case value for current case.
DOTGraphTraits(bool isSimple=false)
static std::string getGraphName(const Function *F)
std::string str() const
str - Get the contents as an std::string.
static std::string getCompleteNodeLabel(const BasicBlock *Node, const Function *)
StringRef getName() const
void WriteAsOperand(raw_ostream &, const Value *, bool PrintTy=true, const Module *Context=0)
std::string getNodeLabel(const BasicBlock *Node, const Function *Graph)
FunctionPass * createCFGPrinterPass()
Interval::succ_iterator succ_begin(Interval *I)
LLVM Basic Block Representation.
static Self fromSuccessorIndex(SwitchInstTy *SI, unsigned SuccessorIndex)
static std::string getSimpleNodeLabel(const BasicBlock *Node, const Function *)
unsigned getSuccessorIndex() const
TerminatorInst * getTerminator()
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
FunctionPass * createCFGOnlyPrinterPass()
static std::string getEdgeSourceLabel(const BasicBlock *Node, succ_const_iterator I)
bool empty() const
empty - Check if the string is empty.