mirror of
https://github.com/exaloop/codon.git
synced 2025-06-03 15:03:52 +08:00
24 lines
574 B
C++
24 lines
574 B
C++
#pragma once
|
|
|
|
#include "sir/transform/pass.h"
|
|
|
|
namespace seq {
|
|
namespace ir {
|
|
namespace transform {
|
|
namespace pythonic {
|
|
|
|
/// Pass to optimize calls of form d[x] = func(d[x], any).
|
|
/// This will work on any dictionary-like object that implements _do_op and
|
|
/// _do_op_throws as well as getters.
|
|
class DictArithmeticOptimization : public OperatorPass {
|
|
public:
|
|
static const std::string KEY;
|
|
std::string getKey() const override { return KEY; }
|
|
void handle(CallInstr *v) override;
|
|
};
|
|
|
|
} // namespace pythonic
|
|
} // namespace transform
|
|
} // namespace ir
|
|
} // namespace seq
|