mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 20:34:38 +00:00
967a04442d
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1596 91177308-0d34-0410-b5e6-96231b3b80d8
38 lines
1.2 KiB
C++
38 lines
1.2 KiB
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;
|
|
}
|
|
|
|
// getAnalysisUsageInfo - This function needs the results of the
|
|
// FindUsedTypes and FindUnsafePointerTypes analysis passes...
|
|
//
|
|
virtual void getAnalysisUsageInfo(Pass::AnalysisSet &Required,
|
|
Pass::AnalysisSet &Destroyed,
|
|
Pass::AnalysisSet &Provided);
|
|
|
|
private:
|
|
TransformsType getTransforms(Module *M, enum Transform);
|
|
};
|
|
|
|
#endif
|