mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
24d5c6a0cc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1509 91177308-0d34-0410-b5e6-96231b3b80d8
31 lines
872 B
C++
31 lines
872 B
C++
//===- llvm/Transforms/SimpleStructMutation.h - Permute Structs --*- C++ -*--=//
|
|
//
|
|
// This pass does is a wrapper that can do a few simple structure mutation
|
|
// transformations.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_TRANSFORMS_SIMPLESTRUCTMUTATION_H
|
|
#define LLVM_TRANSFORMS_SIMPLESTRUCTMUTATION_H
|
|
|
|
#include "llvm/Transforms/IPO/MutateStructTypes.h"
|
|
|
|
class SimpleStructMutation : public MutateStructTypes {
|
|
public:
|
|
enum Transform { SwapElements, SortElements } CurrentXForm;
|
|
|
|
SimpleStructMutation(enum Transform XForm) : CurrentXForm(XForm) {}
|
|
|
|
virtual bool run(Module *M) {
|
|
setTransforms(getTransforms(M, CurrentXForm));
|
|
bool Changed = MutateStructTypes::run(M);
|
|
clearTransforms();
|
|
return Changed;
|
|
}
|
|
|
|
private:
|
|
static TransformsType getTransforms(Module *M, enum Transform);
|
|
};
|
|
|
|
#endif
|