#ifndef SOURCE_FUZZ_TRANSFORMATION_SWAP_COMMUTABLE_OPERANDS_H_
#define SOURCE_FUZZ_TRANSFORMATION_SWAP_COMMUTABLE_OPERANDS_H_
#include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
#include "source/fuzz/transformation.h"
#include "source/fuzz/transformation_context.h"
#include "source/opt/ir_context.h"
namespace spvtools {
namespace fuzz {
class TransformationSwapCommutableOperands : public Transformation {
public:
explicit TransformationSwapCommutableOperands(
protobufs::TransformationSwapCommutableOperands message);
TransformationSwapCommutableOperands(
const protobufs::InstructionDescriptor& instruction_descriptor);
bool IsApplicable(
opt::IRContext* ir_context,
const TransformationContext& transformation_context) const override;
void Apply(opt::IRContext* ir_context,
TransformationContext* transformation_context) const override;
std::unordered_set<uint32_t> GetFreshIds() const override;
protobufs::Transformation ToMessage() const override;
private:
protobufs::TransformationSwapCommutableOperands message_;
};
}
}
#endif