Skip to content

Commit 6991ab1

Browse files
committed
Convert to use Pass infrastructure
llvm-svn: 834
1 parent 578e83d commit 6991ab1

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

llvm/include/llvm/Transforms/Instrumentation/TraceValues.h

+18-5
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
#ifndef LLVM_TRANSFORMS_INSTRUMENTATION_TRACEVALUES_H
1616
#define LLVM_TRANSFORMS_INSTRUMENTATION_TRACEVALUES_H
1717

18-
class Module;
19-
class Method;
20-
class BasicBlock;
18+
#include "llvm/Transforms/Pass.h"
19+
2120
class Instruction;
2221
class Value;
2322
class Type;
@@ -70,6 +69,20 @@ void InsertCodeToTraceValues (Method* method,
7069
bool traceBasicBlockExits,
7170
bool traceMethodExits);
7271

73-
//**************************************************************************/
7472

75-
#endif LLVM_TRANSFORMS_INSTRUMENTATION_TRACEVALUES_H
73+
class InsertTraceCode : public ConcretePass<InsertTraceCode> {
74+
bool TraceBasicBlockExits, TraceMethodExits;
75+
public:
76+
InsertTraceCode(bool traceBasicBlockExits, bool traceMethodExits)
77+
: TraceBasicBlockExits(traceBasicBlockExits),
78+
TraceMethodExits(traceMethodExits) {}
79+
80+
// doPerMethodWork - This method does the work. Always successful.
81+
//
82+
bool doPerMethodWorkVirt(Method *M) {
83+
InsertCodeToTraceValues(M, TraceBasicBlockExits, TraceMethodExits);
84+
return false;
85+
}
86+
};
87+
88+
#endif /*LLVM_TRANSFORMS_INSTRUMENTATION_TRACEVALUES_H*/

0 commit comments

Comments
 (0)