[Orc] Reapply r234815, outputting via stdout instead.
authorLang Hames <lhames@gmail.com>
Tue, 14 Apr 2015 16:58:05 +0000 (16:58 +0000)
committerLang Hames <lhames@gmail.com>
Tue, 14 Apr 2015 16:58:05 +0000 (16:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234908 91177308-0d34-0410-b5e6-96231b3b80d8

test/ExecutionEngine/OrcLazy/hello.ll
tools/lli/OrcLazyJIT.cpp

index dcc6da06386ea780a85d01d4246402f5cdf02561..795224e019b63737f0a49c638c2de95a6e3aeba3 100644 (file)
@@ -1,7 +1,8 @@
-; RUN: lli -jit-kind=orc-lazy %s | FileCheck %s
+; RUN: lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stdout %s | FileCheck %s
 ;
 ; CHECK: Hello
-; CHECK-NEXT: Goodbye
+; CHECK: [ {{.*}}main$orc_body ]
+; CHECK: Goodbye
 
 %class.Foo = type { i8 }
 
index f60a00bcb83c467828039881d721c8625b4132e2..ff8baf0b0798fbb86a3bb81667a01a6fafc868b0 100644 (file)
@@ -17,7 +17,7 @@ using namespace llvm;
 
 namespace {
 
-  enum class DumpKind { NoDump, DumpFuncsToStdErr, DumpModsToStdErr,
+  enum class DumpKind { NoDump, DumpFuncsToStdOut, DumpModsToStdErr,
                         DumpModsToDisk };
 
   cl::opt<DumpKind> OrcDumpKind("orc-lazy-debug",
@@ -26,9 +26,9 @@ namespace {
                                 cl::values(
                                   clEnumValN(DumpKind::NoDump, "no-dump",
                                              "Don't dump anything."),
-                                  clEnumValN(DumpKind::DumpFuncsToStdErr,
-                                             "funcs-to-stderr",
-                                             "Dump function names to stderr."),
+                                  clEnumValN(DumpKind::DumpFuncsToStdOut,
+                                             "funcs-to-stdout",
+                                             "Dump function names to stdout."),
                                   clEnumValN(DumpKind::DumpModsToStdErr,
                                              "mods-to-stderr",
                                              "Dump modules to stderr."),
@@ -63,21 +63,22 @@ OrcLazyJIT::TransformFtor OrcLazyJIT::createDebugDumper() {
   case DumpKind::NoDump:
     return [](std::unique_ptr<Module> M) { return std::move(M); };
 
-  case DumpKind::DumpFuncsToStdErr:
+  case DumpKind::DumpFuncsToStdOut:
     return [](std::unique_ptr<Module> M) {
-      dbgs() << "[ ";
+      printf("[ ");
 
       for (const auto &F : *M) {
         if (F.isDeclaration())
           continue;
 
-        if (F.hasName())
-          dbgs() << F.getName() << " ";
-        else
-          dbgs() << "<anon> ";
+        if (F.hasName()) {
+          std::string Name(F.getName());
+          printf("%s ", Name.c_str());
+        } else
+          printf("<anon> ");
       }
 
-      dbgs() << "]\n";
+      printf("]\n");
       return std::move(M);
     };