Index: llvm/tools/opt-viewer/opt-viewer.py =================================================================== --- llvm/tools/opt-viewer/opt-viewer.py +++ llvm/tools/opt-viewer/opt-viewer.py @@ -120,12 +120,25 @@ indent = line[:max(r.Column, 1) - 1] indent = re.sub('\S', ' ', indent) + # Create expanded message and link if we have a multiline message. + lines = r.message.split('\n') + if len(lines) > 1: + expand_link = '+' + message = lines[0] + expand_message = ''.format('\n'.join(lines[1:])) + else: + expand_link = '' + expand_message = '' + message = r.message print(u''' {r.RelativeHotness} {r.PassWithDiffPrefix} -
{indent}
{r.message}  + +
{indent}
{expand_link}{message}  + {expand_message} + {inlining_context} '''.format(**locals()), file=self.stream) @@ -139,6 +152,23 @@ +