[llvm] r247152 - [WebAssembly] Tidy up some unneeded newline characters.
Dan Gohman via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 9 08:13:36 PDT 2015
Author: djg
Date: Wed Sep 9 10:13:36 2015
New Revision: 247152
URL: http://llvm.org/viewvc/llvm-project?rev=247152&view=rev
Log:
[WebAssembly] Tidy up some unneeded newline characters.
Modified:
llvm/trunk/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp?rev=247152&r1=247151&r2=247152&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp Wed Sep 9 10:13:36 2015
@@ -204,7 +204,7 @@ void WebAssemblyAsmPrinter::EmitGlobalVa
} else {
assert(false && "Only integer and floating-point constants are supported");
}
- OS << ") ;; align " << Align << "\n";
+ OS << ") ;; align " << Align;
OutStreamer->EmitRawText(OS.str());
}
@@ -236,19 +236,20 @@ void WebAssemblyAsmPrinter::EmitFunction
SmallString<128> Str;
raw_svector_ostream OS(Str);
const Function *F = MF->getFunction();
- for (const Argument &A : F->args())
- OS << " (param " << toString(A.getType(), hasAddr64) << ')';
const Type *Rt = F->getReturnType();
- if (!Rt->isVoidTy())
- OS << " (result " << toString(Rt, hasAddr64) << ')';
- OS << '\n';
- OutStreamer->EmitRawText(OS.str());
+ if (!Rt->isVoidTy() || !F->arg_empty()) {
+ for (const Argument &A : F->args())
+ OS << " (param " << toString(A.getType(), hasAddr64) << ')';
+ if (!Rt->isVoidTy())
+ OS << " (result " << toString(Rt, hasAddr64) << ')';
+ OutStreamer->EmitRawText(OS.str());
+ }
}
void WebAssemblyAsmPrinter::EmitFunctionBodyEnd() {
SmallString<128> Str;
raw_svector_ostream OS(Str);
- OS << ") ;; end func " << toSymbol(CurrentFnSym->getName()) << '\n';
+ OS << ") ;; end func " << toSymbol(CurrentFnSym->getName());
OutStreamer->EmitRawText(OS.str());
}
@@ -299,8 +300,6 @@ void WebAssemblyAsmPrinter::EmitInstruct
if (NumDefs != 0)
OS << ')';
- OS << '\n';
-
OutStreamer->EmitRawText(OS.str());
}
More information about the llvm-commits
mailing list