2001-11-10 07:28:25 +00:00
|
|
|
//===- llvm/Transforms/SwapStructContents.h - Permute Structs ----*- C++ -*--=//
|
|
|
|
//
|
|
|
|
// This pass does a simple transformation that swaps all of the elements of the
|
|
|
|
// struct types in the program around.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_TRANSFORMS_SWAPSTRUCTCONTENTS_H
|
|
|
|
#define LLVM_TRANSFORMS_SWAPSTRUCTCONTENTS_H
|
|
|
|
|
2001-11-26 16:49:49 +00:00
|
|
|
#include "llvm/Transforms/MutateStructTypes.h"
|
2001-11-10 07:28:25 +00:00
|
|
|
|
2001-11-26 16:49:49 +00:00
|
|
|
// FIXME: Move to correct location!
|
|
|
|
class PrebuiltStructMutation : public MutateStructTypes {
|
2001-11-10 07:28:25 +00:00
|
|
|
public:
|
2001-11-26 16:49:49 +00:00
|
|
|
enum Transform { SwapElements, SortElements };
|
2001-11-10 07:28:25 +00:00
|
|
|
|
2001-11-26 16:49:49 +00:00
|
|
|
PrebuiltStructMutation(Module *M, enum Transform XForm)
|
|
|
|
: MutateStructTypes(getTransforms(M, XForm)) {}
|
2001-11-10 07:28:25 +00:00
|
|
|
|
2001-11-26 16:49:49 +00:00
|
|
|
private:
|
|
|
|
static TransformsType getTransforms(Module *M, enum Transform);
|
2001-11-10 07:28:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|