mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Change over to use new style pass mechanism, now passes only expose small
creation functions in their public header file, unless they can help it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1816 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -12,6 +12,7 @@
|
||||
#include "llvm/iOther.h"
|
||||
#include "llvm/iMemory.h"
|
||||
#include "llvm/ConstantVals.h"
|
||||
#include "llvm/Pass.h"
|
||||
#include "llvm/Transforms/Scalar/DCE.h"
|
||||
#include "llvm/Transforms/Scalar/ConstantHandling.h"
|
||||
#include "llvm/Transforms/Scalar/ConstantProp.h"
|
||||
@ -413,8 +414,7 @@ static bool DoRaisePass(Method *M) {
|
||||
#if DEBUG_PEEPHOLE_INSTS
|
||||
cerr << "Processing: " << *BI;
|
||||
#endif
|
||||
if (DeadCodeElimination::dceInstruction(BIL, BI) ||
|
||||
ConstantPropogation::doConstantPropogation(BB, BI)) {
|
||||
if (dceInstruction(BIL, BI) || doConstantPropogation(BB, BI)) {
|
||||
Changed = true;
|
||||
#ifdef DEBUG_PEEPHOLE_INSTS
|
||||
cerr << "DeadCode Elinated!\n";
|
||||
@ -429,12 +429,10 @@ static bool DoRaisePass(Method *M) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// RaisePointerReferences::doit - Raise a method representation to a higher
|
||||
// level.
|
||||
//
|
||||
bool RaisePointerReferences::doit(Method *M) {
|
||||
static bool doRPR(Method *M) {
|
||||
#ifdef DEBUG_PEEPHOLE_INSTS
|
||||
cerr << "\n\n\nStarting to work on Method '" << M->getName() << "'\n";
|
||||
#endif
|
||||
@ -459,3 +457,15 @@ bool RaisePointerReferences::doit(Method *M) {
|
||||
|
||||
return Changed;
|
||||
}
|
||||
|
||||
namespace {
|
||||
struct RaisePointerReferences : public MethodPass {
|
||||
virtual bool runOnMethod(Method *M) { return doRPR(M); }
|
||||
};
|
||||
}
|
||||
|
||||
Pass *createRaisePointerReferencesPass() {
|
||||
return new RaisePointerReferences();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user