#include "llvm/Function.h"
#include "llvm/iOther.h"
#include "llvm/iMemory.h"
-#include "llvm/ConstantVals.h"
+#include "llvm/Constants.h"
#include "llvm/Pass.h"
#include "llvm/ConstantHandling.h"
#include "llvm/Transforms/Scalar/DCE.h"
}
-// RaisePointerReferences::doit - Raise a method representation to a higher
+// RaisePointerReferences::doit - Raise a function representation to a higher
// level.
//
static bool doRPR(Function *F) {
cerr << "Looping: \n" << F;
#endif
- // Iterate over the method, refining it, until it converges on a stable
+ // Iterate over the function, refining it, until it converges on a stable
// state
LocalChange = false;
while (DoRaisePass(F)) LocalChange = true;
}
namespace {
- struct RaisePointerReferences : public MethodPass {
- virtual bool runOnMethod(Function *F) { return doRPR(F); }
+ struct RaisePointerReferences : public FunctionPass {
+ const char *getPassName() const { return "Raise Pointer References"; }
+
+ virtual bool runOnFunction(Function *F) { return doRPR(F); }
+
+ virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ AU.preservesCFG();
+ }
};
}