]> granicus.if.org Git - clang/commitdiff
Support: Add a raw_ostream::write_zeros() function. NFCI.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 17 May 2018 22:11:43 +0000 (22:11 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 17 May 2018 22:11:43 +0000 (22:11 +0000)
This will eventually replace MCObjectWriter::WriteZeros.

Part of PR37466.

Differential Revision: https://reviews.llvm.org/D47033

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332675 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CoverageMappingGen.cpp

index 04e2661518ddedcb3177ce7a311404342d14b3cb..49067ebec3e42dde1648abd14f0c8cdb5b1423cc 100644 (file)
@@ -1372,8 +1372,7 @@ void CoverageMappingModuleGen::emit() {
   // and coverage mappings is a multiple of 8.
   if (size_t Rem = OS.str().size() % 8) {
     CoverageMappingSize += 8 - Rem;
-    for (size_t I = 0, S = 8 - Rem; I < S; ++I)
-      OS << '\0';
+    OS.write_zeros(8 - Rem);
   }
   auto *FilenamesAndMappingsVal =
       llvm::ConstantDataArray::getString(Ctx, OS.str(), false);