Convert to use Pass infrastructure
authorChris Lattner <sabre@nondot.org>
Mon, 15 Oct 2001 17:30:18 +0000 (17:30 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 15 Oct 2001 17:30:18 +0000 (17:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@834 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/Instrumentation/TraceValues.h

index af21209f10d0b1c387757ed30a2e7089d17d0557..8f4ee1d981baaac938288515a476f53eccda4967 100644 (file)
@@ -15,9 +15,8 @@
 #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_TRACEVALUES_H
 #define LLVM_TRANSFORMS_INSTRUMENTATION_TRACEVALUES_H
 
-class Module;
-class Method;
-class BasicBlock;
+#include "llvm/Transforms/Pass.h"
+
 class Instruction;
 class Value;
 class Type;
@@ -70,6 +69,20 @@ void            InsertCodeToTraceValues (Method* method,
                                          bool traceBasicBlockExits,
                                          bool traceMethodExits);
 
-//**************************************************************************/
 
-#endif LLVM_TRANSFORMS_INSTRUMENTATION_TRACEVALUES_H
+class InsertTraceCode : public ConcretePass<InsertTraceCode> {
+  bool TraceBasicBlockExits, TraceMethodExits;
+public:
+  InsertTraceCode(bool traceBasicBlockExits, bool traceMethodExits)
+    : TraceBasicBlockExits(traceBasicBlockExits), 
+      TraceMethodExits(traceMethodExits) {}
+
+  // doPerMethodWork - This method does the work.  Always successful.
+  //
+  bool doPerMethodWorkVirt(Method *M) {
+    InsertCodeToTraceValues(M, TraceBasicBlockExits, TraceMethodExits);
+    return false;
+  }
+};
+
+#endif /*LLVM_TRANSFORMS_INSTRUMENTATION_TRACEVALUES_H*/