1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00

SelectionDAG: Reflow code to use early returns, NFC

llvm-svn: 233577
This commit is contained in:
Duncan P. N. Exon Smith 2015-03-30 18:23:28 +00:00
parent 6aa64a7e42
commit 1be15fef4c

View File

@ -520,22 +520,26 @@ void SDNode::print_details(raw_ostream &OS, const SelectionDAG *G) const {
if (getNodeId() != -1) if (getNodeId() != -1)
OS << " [ID=" << getNodeId() << ']'; OS << " [ID=" << getNodeId() << ']';
if (!G)
return;
DebugLoc dl = getDebugLoc(); DebugLoc dl = getDebugLoc();
if (G && !dl.isUnknown()) { if (dl.isUnknown())
DIScope return;
Scope(dl.getScope(G->getMachineFunction().getFunction()->getContext()));
OS << " dbg:"; DIScope Scope(
assert((!Scope || Scope.isScope()) && dl.getScope(G->getMachineFunction().getFunction()->getContext()));
"Scope of a DebugLoc should be null or a DIScope."); OS << " dbg:";
// Omit the directory, since it's usually long and uninteresting. assert((!Scope || Scope.isScope()) &&
if (Scope) "Scope of a DebugLoc should be null or a DIScope.");
OS << Scope.getFilename(); // Omit the directory, since it's usually long and uninteresting.
else if (Scope)
OS << "<unknown>"; OS << Scope.getFilename();
OS << ':' << dl.getLine(); else
if (dl.getCol() != 0) OS << "<unknown>";
OS << ':' << dl.getCol(); OS << ':' << dl.getLine();
} if (unsigned C = dl.getCol())
OS << ':' << C;
} }
static void DumpNodes(const SDNode *N, unsigned indent, const SelectionDAG *G) { static void DumpNodes(const SDNode *N, unsigned indent, const SelectionDAG *G) {