mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-19 12:33:51 +00:00
in -dot-cfg and -dot-cfg-only, when rendering switch instructions,
put the switch value in the successor boxes like we put T/F for branches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86747 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
055d046f48
commit
0a26870d92
@ -71,6 +71,18 @@ struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits {
|
||||
if (const BranchInst *BI = dyn_cast<BranchInst>(Node->getTerminator()))
|
||||
if (BI->isConditional())
|
||||
return (I == succ_begin(Node)) ? "T" : "F";
|
||||
|
||||
// Label source of conditional branches with "T" or "F"
|
||||
if (const SwitchInst *SI = dyn_cast<SwitchInst>(Node->getTerminator())) {
|
||||
unsigned SuccNo = I.getSuccessorIndex();
|
||||
|
||||
if (SuccNo == 0) return "def";
|
||||
|
||||
std::string Str;
|
||||
raw_string_ostream OS(Str);
|
||||
OS << SI->getCaseValue(SuccNo)->getValue();
|
||||
return OS.str();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user