Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit e18eb61

Browse files
committed
Tweak CFGPrinter to wrap very long names.
I added wrapping to the CFGPrinter a while back so the -view-cfg output is actually viewable. I've since enountered very long mangled names with the same problem, so I'm slightly tweaking this code to work in that case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216087 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 1506856 commit e18eb61

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

include/llvm/Analysis/CFGPrinter.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits {
7272
OutStr.erase(OutStr.begin()+i, OutStr.begin()+Idx);
7373
--i;
7474
} else if (ColNum == MaxColumns) { // Wrap lines.
75-
if (LastSpace) {
76-
OutStr.insert(LastSpace, "\\l...");
77-
ColNum = i - LastSpace;
78-
LastSpace = 0;
79-
i += 3; // The loop will advance 'i' again.
80-
}
81-
// Else keep trying to find a space.
75+
// Wrap very long names even though we can't find a space.
76+
if (!LastSpace)
77+
LastSpace = i;
78+
OutStr.insert(LastSpace, "\\l...");
79+
ColNum = i - LastSpace;
80+
LastSpace = 0;
81+
i += 3; // The loop will advance 'i' again.
8282
}
8383
else
8484
++ColNum;

0 commit comments

Comments
 (0)