mirror of https://github.com/exaloop/codon.git
25 lines
572 B
C++
25 lines
572 B
C++
// Copyright (C) 2022-2025 Exaloop Inc. <https://exaloop.io>
|
|
|
|
#pragma once
|
|
|
|
#include "codon/cir/transform/pass.h"
|
|
|
|
namespace codon {
|
|
namespace ir {
|
|
namespace transform {
|
|
namespace pythonic {
|
|
|
|
/// Pass to optimize list1 + list2 + ...
|
|
/// Also handles list slices and list literals efficiently.
|
|
class ListAdditionOptimization : 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 codon
|