mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
[RDF] Print the function name for calls in dumps
llvm-svn: 282191
This commit is contained in:
parent
38eef5294c
commit
4e87f8e468
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user