aboutsummaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir/value.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-04-21 02:43:44 -0300
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-22 21:51:28 -0400
commitf66851e37682ce538172b0945908227ada8d21ac (patch)
tree2e102ea36e034d7be86abae1165010a1b9612ce7 /src/shader_recompiler/frontend/ir/value.h
parentc84bbd9e44e34bba0e602c1a6736535aa531445c (diff)
shader: Use memset to reset instruction arguments
Diffstat (limited to 'src/shader_recompiler/frontend/ir/value.h')
-rw-r--r--src/shader_recompiler/frontend/ir/value.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/shader_recompiler/frontend/ir/value.h b/src/shader_recompiler/frontend/ir/value.h
index 5425e42a1e..7b20824edc 100644
--- a/src/shader_recompiler/frontend/ir/value.h
+++ b/src/shader_recompiler/frontend/ir/value.h
@@ -34,7 +34,7 @@ struct AssociatedInsts;
class Value {
public:
- Value() noexcept : type{IR::Type::Void}, inst{nullptr} {}
+ Value() noexcept = default;
explicit Value(IR::Inst* value) noexcept;
explicit Value(IR::Block* value) noexcept;
explicit Value(IR::Reg value) noexcept;
@@ -78,9 +78,9 @@ public:
private:
void ValidateAccess(IR::Type expected) const;
- IR::Type type;
+ IR::Type type{};
union {
- IR::Inst* inst;
+ IR::Inst* inst{};
IR::Block* label;
IR::Reg reg;
IR::Pred pred;
@@ -95,6 +95,7 @@ private:
f64 imm_f64;
};
};
+static_assert(static_cast<u32>(IR::Type::Void) == 0, "memset relies on IR::Type being zero");
static_assert(std::is_trivially_copyable_v<Value>);
template <IR::Type type_>