summaryrefslogtreecommitdiffstats
path: root/include/llvm/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-18 05:22:27 +0000
committerChris Lattner <sabre@nondot.org>2001-10-18 05:22:27 +0000
commita36941c069cfedb59d53e84e21ee591d6b8af002 (patch)
tree7dc21f68a8848d5618158e6704925e2064e80f5d /include/llvm/Transforms
parent9797a5177144f67a59c63df3d61de87ceb4fd097 (diff)
downloadexternal_llvm-a36941c069cfedb59d53e84e21ee591d6b8af002.zip
external_llvm-a36941c069cfedb59d53e84e21ee591d6b8af002.tar.gz
external_llvm-a36941c069cfedb59d53e84e21ee591d6b8af002.tar.bz2
Convert to new simpler Pass structure
Componentize better git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@879 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms')
-rw-r--r--include/llvm/Transforms/Instrumentation/TraceValues.h73
1 files changed, 16 insertions, 57 deletions
diff --git a/include/llvm/Transforms/Instrumentation/TraceValues.h b/include/llvm/Transforms/Instrumentation/TraceValues.h
index cf27a34..4f9201b 100644
--- a/include/llvm/Transforms/Instrumentation/TraceValues.h
+++ b/include/llvm/Transforms/Instrumentation/TraceValues.h
@@ -17,71 +17,30 @@
#include "llvm/Transforms/Pass.h"
-class Instruction;
-class Value;
-class Type;
-
-
-//************************** External Functions ****************************/
-
-
-//--------------------------------------------------------------------------
-// Function GetPrintMethodForType
-//
-// Creates an external declaration for "printf".
-// The signatures supported are:
-// int printf(sbyte*, sbyte*, sbyte*, sbyte*, int intValue)
-// int printf(sbyte*, sbyte*, sbyte*, sbyte*, unsigned uintValue)
-// int printf(sbyte*, sbyte*, sbyte*, sbyte*, float floatValue)
-// int printf(sbyte*, sbyte*, sbyte*, sbyte*, double doubleValue)
-// int printf(sbyte*, sbyte*, sbyte*, sbyte*, char* stringValue)
-// int printf(sbyte*, sbyte*, sbyte*, sbyte*, void* ptrValue)
-//
-// The invocation should be:
-// call "printf"(fmt, bbName, valueName, valueType, value).
-//--------------------------------------------------------------------------
-
-const Method* GetPrintMethodForType (Module* module,
- Type* vtype);
-
-
-//--------------------------------------------------------------------------
-// Function CreatePrintInstr
-//
-// Creates an invocation of printf for the value `val' at the exit of the
-// basic block `bb'. isMethodExit specifies if this is a method exit,
-//--------------------------------------------------------------------------
-
-Instruction* CreatePrintInstr (Value* val,
- const BasicBlock* bb,
- Module* module,
- unsigned int indent,
- bool isMethodExit);
-
-//--------------------------------------------------------------------------
-// Function InsertCodeToTraceValues
-//
-// Inserts tracing code for all live values at basic block and/or method exits
-// as specified by `traceBasicBlockExits' and `traceMethodExits'.
-//--------------------------------------------------------------------------
-
-void InsertCodeToTraceValues (Method* method,
- bool traceBasicBlockExits,
- bool traceMethodExits);
-
-
-class InsertTraceCode : public ConcretePass {
+class InsertTraceCode : public Pass {
bool TraceBasicBlockExits, TraceMethodExits;
public:
InsertTraceCode(bool traceBasicBlockExits, bool traceMethodExits)
: TraceBasicBlockExits(traceBasicBlockExits),
TraceMethodExits(traceMethodExits) {}
+
+ //--------------------------------------------------------------------------
+ // Function InsertCodeToTraceValues
+ //
+ // Inserts tracing code for all live values at basic block and/or method exits
+ // as specified by `traceBasicBlockExits' and `traceMethodExits'.
+ //--------------------------------------------------------------------------
+
+ static bool doInsertTraceCode(Method *M, bool traceBasicBlockExits,
+ bool traceMethodExits);
+
+
+
// doPerMethodWork - This method does the work. Always successful.
//
- bool doPerMethodWorkVirt(Method *M) {
- InsertCodeToTraceValues(M, TraceBasicBlockExits, TraceMethodExits);
- return false;
+ bool doPerMethodWork(Method *M) {
+ return doInsertTraceCode(M, TraceBasicBlockExits, TraceMethodExits);
}
};