[llvm-commits] CVS: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Fri Jan 16 11:03:02 PST 2004
Changes in directory reopt/lib/LightWtProfiling:
UnpackTraceFunction.cpp updated: 1.27 -> 1.28
---
Log message:
Tweak file header.
Make it a MachineFunctionPass, because it modifies a MachineFunction.
Give it a constructor and a static factory method; make it take a TraceFunction.
---
Diffs of the changes: (+15 -5)
Index: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp
diff -u reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.27 reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.28
--- reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.27 Thu Jan 15 13:40:30 2004
+++ reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp Fri Jan 16 11:02:17 2004
@@ -8,7 +8,8 @@
//===----------------------------------------------------------------------===//
//
// Methods to convert functions, which had previously been converted from
-// traces into functions, back into traces.
+// traces into functions, back into traces, and reattach them to the functions
+// they came from.
//
//===----------------------------------------------------------------------===//
@@ -17,7 +18,7 @@
#include "../../../../lib/Target/Sparc/RegAlloc/PhyRegAlloc.h"
#include "../../../../lib/Target/Sparc/SparcRegInfo.h"
#include "../../../../lib/Target/Sparc/SparcTargetMachine.h"
-#include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/IntrinsicLowering.h"
#include "llvm/Module.h"
@@ -26,12 +27,18 @@
namespace llvm {
-class UnpackTraceFunction : public FunctionPass {
+class UnpackTraceFunction : public MachineFunctionPass {
+ TraceFunction *TF;
public:
+ UnpackTraceFunction (TraceFunction *_TF) : TF (_TF) { }
const char *getPassName () const { return "Unpack trace function"; }
- virtual bool runOnFunction (Function &F);
+ virtual bool runOnMachineFunction (MachineFunction &MF);
};
+MachineFunctionPass *createUnpackTraceFunctionPass (TraceFunction *TF) {
+ return new UnpackTraceFunction (TF);
+}
+
/// Insert the appropriate machine instruction(s) that copies the value in
/// Source to the location specified by Target, at the beginning of B. Note
/// that the current implementation is SPARC-specific.
@@ -279,7 +286,10 @@
}
}
-bool UnpackTraceFunction::runOnFunction (Function &F) {
+bool UnpackTraceFunction::runOnMachineFunction (MachineFunction &MF) {
+ // This is pretty lame, but for now, we can only have one TraceFn
+ // corresponding to one MatrixFn in an UnpackTraceFunction pass.
+
return false;
}
More information about the llvm-commits
mailing list