diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-30 18:23:28 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-30 18:23:28 +0000 |
commit | b525e1c07c304a600bccd22b7993bdc842bc1258 (patch) | |
tree | 8fbfd7a86ecb939b0b6d22595c6d13e2794fcadc /llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp | |
parent | f94d5b5137f1bf002d03d5b53b25dea6dc4701ec (diff) | |
download | bcm5719-llvm-b525e1c07c304a600bccd22b7993bdc842bc1258.tar.gz bcm5719-llvm-b525e1c07c304a600bccd22b7993bdc842bc1258.zip |
SelectionDAG: Reflow code to use early returns, NFC
llvm-svn: 233577
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp index 5898da41c7f..3f8706ea8f1 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp @@ -520,22 +520,26 @@ void SDNode::print_details(raw_ostream &OS, const SelectionDAG *G) const { if (getNodeId() != -1) OS << " [ID=" << getNodeId() << ']'; + if (!G) + return; + DebugLoc dl = getDebugLoc(); - if (G && !dl.isUnknown()) { - DIScope - Scope(dl.getScope(G->getMachineFunction().getFunction()->getContext())); - OS << " dbg:"; - assert((!Scope || Scope.isScope()) && - "Scope of a DebugLoc should be null or a DIScope."); - // Omit the directory, since it's usually long and uninteresting. - if (Scope) - OS << Scope.getFilename(); - else - OS << "<unknown>"; - OS << ':' << dl.getLine(); - if (dl.getCol() != 0) - OS << ':' << dl.getCol(); - } + if (dl.isUnknown()) + return; + + DIScope Scope( + dl.getScope(G->getMachineFunction().getFunction()->getContext())); + OS << " dbg:"; + assert((!Scope || Scope.isScope()) && + "Scope of a DebugLoc should be null or a DIScope."); + // Omit the directory, since it's usually long and uninteresting. + if (Scope) + OS << Scope.getFilename(); + else + OS << "<unknown>"; + OS << ':' << dl.getLine(); + if (unsigned C = dl.getCol()) + OS << ':' << C; } static void DumpNodes(const SDNode *N, unsigned indent, const SelectionDAG *G) { |