[llvm] r293365 - Use print() instead of dump() in code

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 18:47:47 PST 2017


Author: matze
Date: Fri Jan 27 20:47:46 2017
New Revision: 293365

URL: http://llvm.org/viewvc/llvm-project?rev=293365&view=rev
Log:
Use print() instead of dump() in code

The dump() functions are meant to be used in a debugger, code should
typically use something like print(errs());

Modified:
    llvm/trunk/docs/tutorial/LangImpl04.rst
    llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp
    llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp
    llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp
    llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter4/toy.cpp
    llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter5/toy.cpp
    llvm/trunk/examples/Kaleidoscope/Chapter3/toy.cpp
    llvm/trunk/examples/Kaleidoscope/Chapter4/toy.cpp
    llvm/trunk/examples/Kaleidoscope/Chapter5/toy.cpp
    llvm/trunk/examples/Kaleidoscope/Chapter6/toy.cpp
    llvm/trunk/examples/Kaleidoscope/Chapter7/toy.cpp
    llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp
    llvm/trunk/examples/Kaleidoscope/Chapter9/toy.cpp
    llvm/trunk/examples/Kaleidoscope/MCJIT/cached/toy.cpp
    llvm/trunk/examples/Kaleidoscope/MCJIT/complete/toy.cpp
    llvm/trunk/examples/Kaleidoscope/MCJIT/initial/toy.cpp
    llvm/trunk/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp
    llvm/trunk/examples/Kaleidoscope/MCJIT/lazy/toy.cpp
    llvm/trunk/lib/TableGen/TGParser.cpp
    llvm/trunk/utils/TableGen/SubtargetFeatureInfo.cpp

Modified: llvm/trunk/docs/tutorial/LangImpl04.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl04.rst?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl04.rst (original)
+++ llvm/trunk/docs/tutorial/LangImpl04.rst Fri Jan 27 20:47:46 2017
@@ -458,7 +458,8 @@ We also need to update HandleDefinition
       if (auto FnAST = ParseDefinition()) {
         if (auto *FnIR = FnAST->codegen()) {
           fprintf(stderr, "Read function definition:");
-          FnIR->dump();
+          FnIR->print(errs());
+          fprintf(stderr, "\n");
           TheJIT->addModule(std::move(TheModule));
           InitializeModuleAndPassManager();
         }
@@ -472,7 +473,8 @@ We also need to update HandleDefinition
       if (auto ProtoAST = ParseExtern()) {
         if (auto *FnIR = ProtoAST->codegen()) {
           fprintf(stderr, "Read extern: ");
-          FnIR->dump();
+          FnIR->print(errs());
+          fprintf(stderr, "\n");
           FunctionProtos[ProtoAST->getName()] = std::move(ProtoAST);
         }
       } else {

Modified: llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp Fri Jan 27 20:47:46 2017
@@ -1110,7 +1110,8 @@ static void HandleDefinition() {
   if (auto FnAST = ParseDefinition()) {
     if (auto *FnIR = FnAST->codegen()) {
       fprintf(stderr, "Read function definition:");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       TheJIT->addModule(std::move(TheModule));
       InitializeModule();
     }
@@ -1124,7 +1125,8 @@ static void HandleExtern() {
   if (auto ProtoAST = ParseExtern()) {
     if (auto *FnIR = ProtoAST->codegen()) {
       fprintf(stderr, "Read extern: ");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       FunctionProtos[ProtoAST->getName()] = std::move(ProtoAST);
     }
   } else {

Modified: llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp Fri Jan 27 20:47:46 2017
@@ -1110,7 +1110,8 @@ static void HandleDefinition() {
   if (auto FnAST = ParseDefinition()) {
     if (auto *FnIR = FnAST->codegen()) {
       fprintf(stderr, "Read function definition:");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       TheJIT->addModule(std::move(TheModule));
       InitializeModule();
     }
@@ -1124,7 +1125,8 @@ static void HandleExtern() {
   if (auto ProtoAST = ParseExtern()) {
     if (auto *FnIR = ProtoAST->codegen()) {
       fprintf(stderr, "Read extern: ");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       FunctionProtos[ProtoAST->getName()] = std::move(ProtoAST);
     }
   } else {

Modified: llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp Fri Jan 27 20:47:46 2017
@@ -1110,7 +1110,8 @@ static void HandleDefinition() {
   if (auto FnAST = ParseDefinition()) {
     if (auto *FnIR = FnAST->codegen()) {
       fprintf(stderr, "Read function definition:");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       TheJIT->addModule(std::move(TheModule));
       InitializeModule();
     }
@@ -1124,7 +1125,8 @@ static void HandleExtern() {
   if (auto ProtoAST = ParseExtern()) {
     if (auto *FnIR = ProtoAST->codegen()) {
       fprintf(stderr, "Read extern: ");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       FunctionProtos[ProtoAST->getName()] = std::move(ProtoAST);
     }
   } else {

Modified: llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter4/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter4/toy.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter4/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter4/toy.cpp Fri Jan 27 20:47:46 2017
@@ -1126,7 +1126,8 @@ static void HandleExtern() {
   if (auto ProtoAST = ParseExtern()) {
     if (auto *FnIR = ProtoAST->codegen()) {
       fprintf(stderr, "Read extern: ");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       FunctionProtos[ProtoAST->getName()] = std::move(ProtoAST);
     }
   } else {

Modified: llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter5/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter5/toy.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter5/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter5/toy.cpp Fri Jan 27 20:47:46 2017
@@ -1150,7 +1150,8 @@ static void HandleExtern() {
   if (auto ProtoAST = ParseExtern()) {
     if (auto *FnIR = ProtoAST->codegen()) {
       fprintf(stderr, "Read extern: ");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       FunctionProtos[ProtoAST->getName()] = std::move(ProtoAST);
     }
   } else {

Modified: llvm/trunk/examples/Kaleidoscope/Chapter3/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Chapter3/toy.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/Chapter3/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/Chapter3/toy.cpp Fri Jan 27 20:47:46 2017
@@ -522,7 +522,8 @@ static void HandleDefinition() {
   if (auto FnAST = ParseDefinition()) {
     if (auto *FnIR = FnAST->codegen()) {
       fprintf(stderr, "Read function definition:");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
     }
   } else {
     // Skip token for error recovery.
@@ -534,7 +535,8 @@ static void HandleExtern() {
   if (auto ProtoAST = ParseExtern()) {
     if (auto *FnIR = ProtoAST->codegen()) {
       fprintf(stderr, "Read extern: ");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
     }
   } else {
     // Skip token for error recovery.
@@ -547,7 +549,8 @@ static void HandleTopLevelExpression() {
   if (auto FnAST = ParseTopLevelExpr()) {
     if (auto *FnIR = FnAST->codegen()) {
       fprintf(stderr, "Read top-level expression:");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
     }
   } else {
     // Skip token for error recovery.
@@ -601,7 +604,7 @@ int main() {
   MainLoop();
 
   // Print out all of the generated code.
-  TheModule->dump();
+  TheModule->print(errs(), nullptr);
 
   return 0;
 }

Modified: llvm/trunk/examples/Kaleidoscope/Chapter4/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Chapter4/toy.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/Chapter4/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/Chapter4/toy.cpp Fri Jan 27 20:47:46 2017
@@ -571,7 +571,8 @@ static void HandleDefinition() {
   if (auto FnAST = ParseDefinition()) {
     if (auto *FnIR = FnAST->codegen()) {
       fprintf(stderr, "Read function definition:");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       TheJIT->addModule(std::move(TheModule));
       InitializeModuleAndPassManager();
     }
@@ -585,7 +586,8 @@ static void HandleExtern() {
   if (auto ProtoAST = ParseExtern()) {
     if (auto *FnIR = ProtoAST->codegen()) {
       fprintf(stderr, "Read extern: ");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       FunctionProtos[ProtoAST->getName()] = std::move(ProtoAST);
     }
   } else {

Modified: llvm/trunk/examples/Kaleidoscope/Chapter5/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Chapter5/toy.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/Chapter5/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/Chapter5/toy.cpp Fri Jan 27 20:47:46 2017
@@ -845,7 +845,8 @@ static void HandleDefinition() {
   if (auto FnAST = ParseDefinition()) {
     if (auto *FnIR = FnAST->codegen()) {
       fprintf(stderr, "Read function definition:");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       TheJIT->addModule(std::move(TheModule));
       InitializeModuleAndPassManager();
     }
@@ -859,7 +860,8 @@ static void HandleExtern() {
   if (auto ProtoAST = ParseExtern()) {
     if (auto *FnIR = ProtoAST->codegen()) {
       fprintf(stderr, "Read extern: ");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       FunctionProtos[ProtoAST->getName()] = std::move(ProtoAST);
     }
   } else {

Modified: llvm/trunk/examples/Kaleidoscope/Chapter6/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Chapter6/toy.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/Chapter6/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/Chapter6/toy.cpp Fri Jan 27 20:47:46 2017
@@ -964,7 +964,8 @@ static void HandleDefinition() {
   if (auto FnAST = ParseDefinition()) {
     if (auto *FnIR = FnAST->codegen()) {
       fprintf(stderr, "Read function definition:");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       TheJIT->addModule(std::move(TheModule));
       InitializeModuleAndPassManager();
     }
@@ -978,7 +979,8 @@ static void HandleExtern() {
   if (auto ProtoAST = ParseExtern()) {
     if (auto *FnIR = ProtoAST->codegen()) {
       fprintf(stderr, "Read extern: ");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       FunctionProtos[ProtoAST->getName()] = std::move(ProtoAST);
     }
   } else {

Modified: llvm/trunk/examples/Kaleidoscope/Chapter7/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Chapter7/toy.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/Chapter7/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/Chapter7/toy.cpp Fri Jan 27 20:47:46 2017
@@ -1131,7 +1131,8 @@ static void HandleDefinition() {
   if (auto FnAST = ParseDefinition()) {
     if (auto *FnIR = FnAST->codegen()) {
       fprintf(stderr, "Read function definition:");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       TheJIT->addModule(std::move(TheModule));
       InitializeModuleAndPassManager();
     }
@@ -1145,7 +1146,8 @@ static void HandleExtern() {
   if (auto ProtoAST = ParseExtern()) {
     if (auto *FnIR = ProtoAST->codegen()) {
       fprintf(stderr, "Read extern: ");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       FunctionProtos[ProtoAST->getName()] = std::move(ProtoAST);
     }
   } else {

Modified: llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/Chapter8/toy.cpp Fri Jan 27 20:47:46 2017
@@ -1114,7 +1114,8 @@ static void HandleDefinition() {
   if (auto FnAST = ParseDefinition()) {
     if (auto *FnIR = FnAST->codegen()) {
       fprintf(stderr, "Read function definition:");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
     }
   } else {
     // Skip token for error recovery.
@@ -1126,7 +1127,8 @@ static void HandleExtern() {
   if (auto ProtoAST = ParseExtern()) {
     if (auto *FnIR = ProtoAST->codegen()) {
       fprintf(stderr, "Read extern: ");
-      FnIR->dump();
+      FnIR->print(errs());
+      fprintf(stderr, "\n");
       FunctionProtos[ProtoAST->getName()] = std::move(ProtoAST);
     }
   } else {

Modified: llvm/trunk/examples/Kaleidoscope/Chapter9/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Chapter9/toy.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/Chapter9/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/Chapter9/toy.cpp Fri Jan 27 20:47:46 2017
@@ -1439,7 +1439,7 @@ int main() {
   DBuilder->finalize();
 
   // Print out all of the generated code.
-  TheModule->dump();
+  TheModule->print(errs(), nullptr);
 
   return 0;
 }

Modified: llvm/trunk/examples/Kaleidoscope/MCJIT/cached/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/MCJIT/cached/toy.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/MCJIT/cached/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/MCJIT/cached/toy.cpp Fri Jan 27 20:47:46 2017
@@ -1395,7 +1395,8 @@ static void HandleDefinition() {
     if (Function *LF = F->Codegen()) {
 #ifndef MINIMAL_STDERR_OUTPUT
       fprintf(stderr, "Read function definition:");
-      LF->dump();
+      LF->print(errs());
+      fprintf(stderr, "\n");
 #endif
     }
   } else {
@@ -1409,7 +1410,8 @@ static void HandleExtern() {
     if (Function *F = P->Codegen()) {
 #ifndef MINIMAL_STDERR_OUTPUT
       fprintf(stderr, "Read extern: ");
-      F->dump();
+      F->print(errs());
+      fprintf(stderr, "\n");
 #endif
     }
   } else {
@@ -1540,7 +1542,7 @@ int main(int argc, char **argv) {
 
 #ifndef MINIMAL_STDERR_OUTPUT
   // Print out all of the generated code.
-  TheHelper->dump();
+  TheHelper->print(errs());
 #endif
 
   return 0;

Modified: llvm/trunk/examples/Kaleidoscope/MCJIT/complete/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/MCJIT/complete/toy.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/MCJIT/complete/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/MCJIT/complete/toy.cpp Fri Jan 27 20:47:46 2017
@@ -1474,7 +1474,8 @@ static void HandleDefinition() {
     Function *LF = F->Codegen();
     if (LF && VerboseOutput) {
       fprintf(stderr, "Read function definition:");
-      LF->dump();
+      LF->print(errs());
+      fprintf(stderr, "\n");
     }
   } else {
     // Skip token for error recovery.
@@ -1487,7 +1488,8 @@ static void HandleExtern() {
     Function *F = P->Codegen();
     if (F && VerboseOutput) {
       fprintf(stderr, "Read extern: ");
-      F->dump();
+      F->print(errs());
+      fprintf(stderr, "\n");
     }
   } else {
     // Skip token for error recovery.

Modified: llvm/trunk/examples/Kaleidoscope/MCJIT/initial/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/MCJIT/initial/toy.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/MCJIT/initial/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/MCJIT/initial/toy.cpp Fri Jan 27 20:47:46 2017
@@ -1252,7 +1252,8 @@ static void HandleDefinition() {
     if (Function *LF = F->Codegen()) {
 #ifndef MINIMAL_STDERR_OUTPUT
       fprintf(stderr, "Read function definition:");
-      LF->dump();
+      LF->print(errs());
+      fprintf(stderr, "\n");
 #endif
     }
   } else {
@@ -1266,7 +1267,8 @@ static void HandleExtern() {
     if (Function *F = P->Codegen()) {
 #ifndef MINIMAL_STDERR_OUTPUT
       fprintf(stderr, "Read extern: ");
-      F->dump();
+      F->print(errs());
+      fprintf(stderr, "\n");
 #endif
     }
   } else {
@@ -1370,7 +1372,7 @@ int main() {
 
 #ifndef MINIMAL_STDERR_OUTPUT
   // Print out all of the generated code.
-  TheHelper->dump();
+  TheHelper->print(errs());
 #endif
 
   return 0;

Modified: llvm/trunk/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp Fri Jan 27 20:47:46 2017
@@ -1010,7 +1010,8 @@ static void HandleDefinition() {
     if (Function *LF = F->Codegen()) {
 #ifndef MINIMAL_STDERR_OUTPUT
       fprintf(stderr, "Read function definition:");
-      LF->dump();
+      LF->print(errs());
+      fprintf(stderr, "\n");
 #endif
     }
   } else {
@@ -1024,7 +1025,8 @@ static void HandleExtern() {
     if (Function *F = P->Codegen()) {
 #ifndef MINIMAL_STDERR_OUTPUT
       fprintf(stderr, "Read extern: ");
-      F->dump();
+      F->print(errs());
+      fprintf(stderr, "\n");
 #endif
     }
   } else {
@@ -1157,7 +1159,7 @@ int main(int argc, char **argv) {
   // Print out all of the generated code.
   TheFPM = 0;
 #ifndef MINIMAL_STDERR_OUTPUT
-  TheModule->dump();
+  TheModule->print(errs(), nullptr);
 #endif
   return 0;
 }

Modified: llvm/trunk/examples/Kaleidoscope/MCJIT/lazy/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/MCJIT/lazy/toy.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/MCJIT/lazy/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/MCJIT/lazy/toy.cpp Fri Jan 27 20:47:46 2017
@@ -1293,7 +1293,8 @@ static void HandleDefinition() {
     if (Function *LF = F->Codegen()) {
 #ifndef MINIMAL_STDERR_OUTPUT
       fprintf(stderr, "Read function definition:");
-      LF->dump();
+      LF->print(errs());
+      fprintf(stderr, "\n");
 #endif
     }
   } else {
@@ -1307,7 +1308,8 @@ static void HandleExtern() {
     if (Function *F = P->Codegen()) {
 #ifndef MINIMAL_STDERR_OUTPUT
       fprintf(stderr, "Read extern: ");
-      F->dump();
+      F->print(errs());
+      fprintf(stderr, "\n");
 #endif
     }
   } else {

Modified: llvm/trunk/lib/TableGen/TGParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/TGParser.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/TGParser.cpp (original)
+++ llvm/trunk/lib/TableGen/TGParser.cpp Fri Jan 27 20:47:46 2017
@@ -54,6 +54,7 @@ struct SubMultiClassReference {
   void dump() const;
 };
 
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
 LLVM_DUMP_METHOD void SubMultiClassReference::dump() const {
   errs() << "Multiclass:\n";
 
@@ -63,6 +64,7 @@ LLVM_DUMP_METHOD void SubMultiClassRefer
   for (Init *TA : TemplateArgs)
     TA->dump();
 }
+#endif
 
 } // end namespace llvm
 

Modified: llvm/trunk/utils/TableGen/SubtargetFeatureInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/SubtargetFeatureInfo.cpp?rev=293365&r1=293364&r2=293365&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/SubtargetFeatureInfo.cpp (original)
+++ llvm/trunk/utils/TableGen/SubtargetFeatureInfo.cpp Fri Jan 27 20:47:46 2017
@@ -16,10 +16,11 @@
 
 using namespace llvm;
 
-void SubtargetFeatureInfo::dump() const {
-  errs() << getEnumName() << " " << Index << "\n";
-  TheDef->dump();
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+LLVM_DUMP_METHOD void SubtargetFeatureInfo::dump() const {
+  errs() << getEnumName() << " " << Index << "\n" << *TheDef;
 }
+#endif
 
 std::vector<std::pair<Record *, SubtargetFeatureInfo>>
 SubtargetFeatureInfo::getAll(const RecordKeeper &Records) {




More information about the llvm-commits mailing list