Skip to content

Commit

Permalink
Allow constructing PassRepeated from a PassManager (#4319)
Browse files Browse the repository at this point in the history
and add `explicit` to the constructors that could be accidentally invoked by implicit casts otherwise.
  • Loading branch information
vlstill authored Jan 5, 2024
1 parent 8cc98af commit fa4cc97
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ir/pass_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ class PassRepeated : virtual public PassManager {
unsigned repeats; // 0 = until convergence
public:
PassRepeated() : repeats(0) {}
PassRepeated(const std::initializer_list<VisitorRef> &init, unsigned repeats = 0)
explicit PassRepeated(const std::initializer_list<VisitorRef> &init, unsigned repeats = 0)
: PassManager(init), repeats(repeats) {}
explicit PassRepeated(const PassManager &other, unsigned repeats = 0)
: PassManager(other), repeats(repeats) {}
const IR::Node *apply_visitor(const IR::Node *, const char * = 0) override;
PassRepeated *setRepeats(unsigned repeats) {
this->repeats = repeats;
Expand Down

0 comments on commit fa4cc97

Please sign in to comment.