diff options
author | Reid Kleckner <rnk@google.com> | 2020-01-27 13:49:09 -0800 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2020-01-27 15:34:05 -0800 |
commit | c23212a438f6ff20bf1d98e5ca23c5cd28591ce3 (patch) | |
tree | 1e603cb4cc0cfa349362283f55206ec48f61241c /llvm/lib | |
parent | 72882ca30d87bd7ea85d8099e8b9d2244749b71e (diff) | |
download | bcm5719-llvm-c23212a438f6ff20bf1d98e5ca23c5cd28591ce3.tar.gz bcm5719-llvm-c23212a438f6ff20bf1d98e5ca23c5cd28591ce3.zip |
[IR] Keep a double break between functions when printing a module
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.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D73505
(cherry picked from commit 9521c18438a9f09663f3dc68aa7581371c0653c9)
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/IR/AsmWriter.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index acf0e4afef2..1f978d13604 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -2651,8 +2651,10 @@ void AssemblyWriter::printModule(const Module *M) { printUseLists(nullptr); // Output all of the functions. - for (const Function &F : *M) + for (const Function &F : *M) { + Out << '\n'; printFunction(&F); + } assert(UseListOrders.empty() && "All use-lists should have been consumed"); // Output all attribute groups. |