diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2016-09-22 20:58:19 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2016-09-22 20:58:19 +0000 |
commit | 670e0ca24fde1b7f03f9dfe8b6fb544ec03d4888 (patch) | |
tree | bd43a36d8d687b09cbf40574acade96db52e3cbe | |
parent | c51f2394a6211286f4d6f80de0e04d5cd534a1d9 (diff) | |
download | bcm5719-llvm-670e0ca24fde1b7f03f9dfe8b6fb544ec03d4888.tar.gz bcm5719-llvm-670e0ca24fde1b7f03f9dfe8b6fb544ec03d4888.zip |
[RDF] Print the function name for calls in dumps
llvm-svn: 282191
-rw-r--r-- | llvm/lib/Target/Hexagon/RDFGraph.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/llvm/lib/Target/Hexagon/RDFGraph.cpp b/llvm/lib/Target/Hexagon/RDFGraph.cpp index 72d443309e3..bea9a837127 100644 --- a/llvm/lib/Target/Hexagon/RDFGraph.cpp +++ b/llvm/lib/Target/Hexagon/RDFGraph.cpp @@ -210,9 +210,24 @@ raw_ostream &operator<< (raw_ostream &OS, const Print<NodeAddr<PhiNode*>> &P) { template<> raw_ostream &operator<< (raw_ostream &OS, const Print<NodeAddr<StmtNode*>> &P) { - unsigned Opc = P.Obj.Addr->getCode()->getOpcode(); - OS << Print<NodeId>(P.Obj.Id, P.G) << ": " << P.G.getTII().getName(Opc) - << " [" << PrintListV<RefNode*>(P.Obj.Addr->members(P.G), P.G) << ']'; + const MachineInstr &MI = *P.Obj.Addr->getCode(); + unsigned Opc = MI.getOpcode(); + OS << Print<NodeId>(P.Obj.Id, P.G) << ": " << P.G.getTII().getName(Opc); + // Print the target for calls (for readability). + if (MI.getDesc().isCall()) { + MachineInstr::const_mop_iterator Fn = + find_if(MI.operands(), + [] (const MachineOperand &Op) -> bool { + return Op.isGlobal() || Op.isSymbol(); + }); + if (Fn != MI.operands_end()) { + if (Fn->isGlobal()) + OS << ' ' << Fn->getGlobal()->getName(); + else if (Fn->isSymbol()) + OS << ' ' << Fn->getSymbolName(); + } + } + OS << " [" << PrintListV<RefNode*>(P.Obj.Addr->members(P.G), P.G) << ']'; return OS; } |