[PM] Add names to passes under the new pass manager, and a debug output
mode that can be used to debug the execution of everything.

No support for analyses here, that will come later. This already helps
show parts of the opt commandline integration that isn't working. Tests
of that will start using it as the bugs are fixed.

llvm-svn: 199004
diff --git a/llvm/unittests/IR/PassManagerTest.cpp b/llvm/unittests/IR/PassManagerTest.cpp
index 8db9c67..7b2b46a 100644
--- a/llvm/unittests/IR/PassManagerTest.cpp
+++ b/llvm/unittests/IR/PassManagerTest.cpp
@@ -86,6 +86,8 @@
     return PreservedAnalyses::none();
   }
 
+  static StringRef name() { return "TestModulePass"; }
+
   int &RunCount;
 };
 
@@ -93,6 +95,8 @@
   PreservedAnalyses run(Module *M) {
     return PreservedAnalyses::all();
   }
+
+  static StringRef name() { return "TestPreservingModulePass"; }
 };
 
 struct TestMinPreservingModulePass {
@@ -105,6 +109,8 @@
     PA.preserve<FunctionAnalysisManagerModuleProxy>();
     return PA;
   }
+
+  static StringRef name() { return "TestMinPreservingModulePass"; }
 };
 
 struct TestFunctionPass {
@@ -138,6 +144,8 @@
     return PreservedAnalyses::all();
   }
 
+  static StringRef name() { return "TestFunctionPass"; }
+
   int &RunCount;
   int &AnalyzedInstrCount;
   int &AnalyzedFunctionCount;
@@ -154,6 +162,8 @@
                                 : PreservedAnalyses::all();
   }
 
+  static StringRef name() { return "TestInvalidationFunctionPass"; }
+
   StringRef Name;
 };