parent
fcda44a75d
commit
e1531446aa
|
|
@ -8,28 +8,18 @@
|
||||||
#ifndef LLVM_TRANSFORMS_SWAPSTRUCTCONTENTS_H
|
#ifndef LLVM_TRANSFORMS_SWAPSTRUCTCONTENTS_H
|
||||||
#define LLVM_TRANSFORMS_SWAPSTRUCTCONTENTS_H
|
#define LLVM_TRANSFORMS_SWAPSTRUCTCONTENTS_H
|
||||||
|
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Transforms/MutateStructTypes.h"
|
||||||
|
|
||||||
class SwapStructContents : public Pass {
|
// FIXME: Move to correct location!
|
||||||
Pass *StructMutator;
|
class PrebuiltStructMutation : public MutateStructTypes {
|
||||||
public:
|
public:
|
||||||
// doPassInitialization - Figure out what transformation to do
|
enum Transform { SwapElements, SortElements };
|
||||||
//
|
|
||||||
bool doPassInitialization(Module *M);
|
|
||||||
|
|
||||||
// doPerMethodWork - Virtual method overriden by subclasses to do the
|
PrebuiltStructMutation(Module *M, enum Transform XForm)
|
||||||
// per-method processing of the pass.
|
: MutateStructTypes(getTransforms(M, XForm)) {}
|
||||||
//
|
|
||||||
virtual bool doPerMethodWork(Method *M) {
|
|
||||||
return StructMutator->doPerMethodWork(M);
|
|
||||||
}
|
|
||||||
|
|
||||||
// doPassFinalization - Forward to our worker.
|
|
||||||
//
|
|
||||||
virtual bool doPassFinalization(Module *M) {
|
|
||||||
return StructMutator->doPassFinalization(M);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
static TransformsType getTransforms(Module *M, enum Transform);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue