This is an archive of the discontinued LLVM Phabricator instance.

[IR] Keep a double break between function decls and defs
ClosedPublic

Authored by rnk on Jan 27 2020, 1:49 PM.

Details

Summary

This behavior appears to have changed unintentionally in
b0e979724f2679e4e6f5b824144ea89289bd6d56.

Instead of printing the leading newline in printFunction, print it when
printing a module. This ensures that OS << *Func starts printing
immediately on the current line, but whole modules are printed nicely.

Diff Detail

Event Timeline

rnk created this revision.Jan 27 2020, 1:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 27 2020, 1:49 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
MaskRay accepted this revision.Jan 27 2020, 2:16 PM

Thanks. b0e979724f2679e4e6f5b824144ea89289bd6d56 intended to make newpm and oldpm -print-after-all output similar. I did not realize llvm-dis output is also affected.

Keep a double break between function decls and defs

This patch also inserts an empty line between two declarations or two definitions.

(It actually adds a newline before printing any declaration or definition.)

This revision is now accepted and ready to land.Jan 27 2020, 2:16 PM

Unit tests: pass. 62246 tests passed, 0 failed and 816 were skipped.

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

This revision was automatically updated to reflect the committed changes.
rnk added a comment.Jan 27 2020, 3:35 PM

Keep a double break between function decls and defs

This patch also inserts an empty line between two declarations or two definitions.

(It actually adds a newline before printing any declaration or definition.)

I meant to indicate that a double break should appear between both kinds of function, so I will just say "functions".

@hans, I will merge this to the release/10.x branch, let me know if that needs more review or should be undone.

hans added a comment.Jan 27 2020, 3:39 PM

@hans, I will merge this to the release/10.x branch, let me know if that needs more review or should be undone.

Sounds good to me, go ahead.