2001-10-18 20:19:09 +00:00
|
|
|
//===- llvm/Transforms/Instrumentation/TraceValues.h - Tracing ---*- C++ -*--=//
|
|
|
|
//
|
|
|
|
// Support for inserting LLVM code to print values at basic block and method
|
|
|
|
// exits.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2001-10-14 23:19:02 +00:00
|
|
|
|
|
|
|
#ifndef LLVM_TRANSFORMS_INSTRUMENTATION_TRACEVALUES_H
|
|
|
|
#define LLVM_TRANSFORMS_INSTRUMENTATION_TRACEVALUES_H
|
|
|
|
|
2001-10-18 20:19:09 +00:00
|
|
|
#include "llvm/Pass.h"
|
2001-10-15 17:30:18 +00:00
|
|
|
|
2001-10-18 05:22:27 +00:00
|
|
|
class InsertTraceCode : public Pass {
|
2001-10-15 17:30:18 +00:00
|
|
|
bool TraceBasicBlockExits, TraceMethodExits;
|
|
|
|
public:
|
|
|
|
InsertTraceCode(bool traceBasicBlockExits, bool traceMethodExits)
|
|
|
|
: TraceBasicBlockExits(traceBasicBlockExits),
|
|
|
|
TraceMethodExits(traceMethodExits) {}
|
|
|
|
|
2001-10-18 05:22:27 +00:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
// Function InsertCodeToTraceValues
|
|
|
|
//
|
|
|
|
// Inserts tracing code for all live values at basic block and/or method exits
|
|
|
|
// as specified by `traceBasicBlockExits' and `traceMethodExits'.
|
2001-10-18 20:19:09 +00:00
|
|
|
//
|
2001-10-18 05:22:27 +00:00
|
|
|
static bool doInsertTraceCode(Method *M, bool traceBasicBlockExits,
|
|
|
|
bool traceMethodExits);
|
|
|
|
|
2001-10-15 17:30:18 +00:00
|
|
|
// doPerMethodWork - This method does the work. Always successful.
|
|
|
|
//
|
2001-10-18 05:22:27 +00:00
|
|
|
bool doPerMethodWork(Method *M) {
|
|
|
|
return doInsertTraceCode(M, TraceBasicBlockExits, TraceMethodExits);
|
2001-10-15 17:30:18 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /*LLVM_TRANSFORMS_INSTRUMENTATION_TRACEVALUES_H*/
|