Skip to content

Commit

Permalink
Make FifoConfig constexpr-constructible.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 679331734
  • Loading branch information
grebe authored and copybara-github committed Sep 26, 2024
1 parent d7fa549 commit 5eed636
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
7 changes: 0 additions & 7 deletions xls/ir/channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@
#include "xls/ir/value_utils.h"

namespace xls {
FifoConfig::FifoConfig(int64_t depth, bool bypass, bool register_push_outputs,
bool register_pop_outputs)
: depth_(depth),
bypass_(bypass),
register_push_outputs_(register_push_outputs),
register_pop_outputs_(register_pop_outputs) {}

/* static */ absl::StatusOr<FifoConfig> FifoConfig::FromProto(
const FifoConfigProto& proto) {
if (!proto.has_depth()) {
Expand Down
8 changes: 6 additions & 2 deletions xls/ir/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ enum class ChannelKind : uint8_t {

class FifoConfig {
public:
FifoConfig(int64_t depth, bool bypass, bool register_push_outputs,
bool register_pop_outputs);
constexpr FifoConfig(int64_t depth, bool bypass, bool register_push_outputs,
bool register_pop_outputs)
: depth_(depth),
bypass_(bypass),
register_push_outputs_(register_push_outputs),
register_pop_outputs_(register_pop_outputs) {}

int64_t depth() const { return depth_; }
bool bypass() const { return bypass_; }
Expand Down

0 comments on commit 5eed636

Please sign in to comment.