From 18c37509fa44b8c6e4543b5d429fbae5d8fe4e5d Mon Sep 17 00:00:00 2001 From: GPUCode <47210458+GPUCode@users.noreply.github.com> Date: Sun, 20 Nov 2022 13:01:05 +0200 Subject: [PATCH] Support variadic arguments for OpPhi --- include/sirit/sirit.h | 6 ++++++ src/stream.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/sirit/sirit.h b/include/sirit/sirit.h index 0a9fce9..dc3c567 100644 --- a/include/sirit/sirit.h +++ b/include/sirit/sirit.h @@ -256,6 +256,12 @@ public: */ Id OpPhi(Id result_type, std::span operands); + template + requires(...&& std::is_convertible_v) Id + OpPhi(Id result_type, Ts&&... operands) { + return OpPhi(result_type, std::span({operands...})); + } + /** * The SSA phi function. This instruction will be revisited when patching phi nodes. * diff --git a/src/stream.h b/src/stream.h index 42e2041..bf9e48a 100644 --- a/src/stream.h +++ b/src/stream.h @@ -7,11 +7,11 @@ #pragma once #include -#include #include #include #include #include +#include #include #include #include