Support variadic arguments for OpPhi

This commit is contained in:
GPUCode 2022-11-20 13:01:05 +02:00 committed by GPUCode
parent d75e3198d0
commit 18c37509fa
2 changed files with 7 additions and 1 deletions

View file

@ -256,6 +256,12 @@ public:
*/
Id OpPhi(Id result_type, std::span<const Id> operands);
template <typename... Ts>
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpPhi(Id result_type, Ts&&... operands) {
return OpPhi(result_type, std::span<const Id>({operands...}));
}
/**
* The SSA phi function. This instruction will be revisited when patching phi nodes.
*

View file

@ -7,11 +7,11 @@
#pragma once
#include <bit>
#include <span>
#include <cassert>
#include <concepts>
#include <cstddef>
#include <functional>
#include <span>
#include <string_view>
#include <unordered_map>
#include <variant>