[PATCH] D40126: [Polly] [PCGCodeGen] Change printf to outs() to prevent garbled output. [NFC]

Siddharth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 4 09:56:25 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL336288: [PPCGCodeGen] Change printf to outs() to prevent garbled output. [NFC] (authored by bollu, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D40126?vs=123170&id=154132#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D40126

Files:
  polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp


Index: polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp
===================================================================
--- polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp
+++ polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -3163,7 +3163,7 @@
     auto *Options = isl_ast_print_options_alloc(S->getIslCtx().get());
     P = isl_ast_node_print(Kernel->tree, P, Options);
     char *String = isl_printer_get_str(P);
-    printf("%s\n", String);
+    outs() << String << "\n";
     free(String);
     isl_printer_free(P);
   }
@@ -3184,13 +3184,13 @@
         isl_ast_print_options_set_print_user(Options, printHostUser, &Data);
     P = isl_ast_node_print(Tree, P, Options);
     char *String = isl_printer_get_str(P);
-    printf("# host\n");
-    printf("%s\n", String);
+    outs() << "# host\n";
+    outs() << String << "\n";
     free(String);
     isl_printer_free(P);
 
     for (auto Kernel : Data.Kernels) {
-      printf("# kernel%d\n", Kernel->id);
+      outs() << "# kernel" << Kernel->id << "\n";
       printKernel(Kernel);
     }
   }
@@ -3255,17 +3255,17 @@
       else
         P = isl_printer_print_str(P, "No schedule found\n");
 
-      printf("%s\n", isl_printer_get_str(P));
+      outs() << isl_printer_get_str(P) << "\n";
       isl_printer_free(P);
     }
 
     if (DumpCode) {
-      printf("Code\n");
-      printf("====\n");
+      outs() << "Code\n";
+      outs() << "====\n";
       if (PPCGGen->tree)
         printGPUTree(PPCGGen->tree, PPCGProg);
       else
-        printf("No code generated\n");
+        outs() << "No code generated\n";
     }
 
     isl_schedule_free(Schedule);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40126.154132.patch
Type: text/x-patch
Size: 1622 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180704/30c97675/attachment.bin>


More information about the llvm-commits mailing list