shader_recompiler: GCC fixes

Fixes members of unnamed union not being accessible, and one function
without a declaration.
This commit is contained in:
lat9nq 2021-05-16 17:06:13 -04:00 committed by ameerj
parent d4f9c798d6
commit f7a2340205
7 changed files with 55 additions and 58 deletions

View file

@ -13,10 +13,6 @@ namespace Shader::IR {
class Block;
struct AbstractSyntaxNode {
struct NonTrivialDummy {
NonTrivialDummy() {}
};
enum class Type {
Block,
If,
@ -27,9 +23,7 @@ struct AbstractSyntaxNode {
Return,
Unreachable,
};
Type type{};
union {
NonTrivialDummy dummy{};
union Data {
Block* block;
struct {
U1 cond;
@ -55,6 +49,9 @@ struct AbstractSyntaxNode {
Block* skip;
} break_node;
};
Data data{};
Type type{};
};
using AbstractSyntaxList = std::vector<AbstractSyntaxNode>;

View file

@ -20,7 +20,7 @@ BlockList PostOrder(const AbstractSyntaxNode& root) {
if (root.type != AbstractSyntaxNode::Type::Block) {
throw LogicError("First node in abstract syntax list root is not a block");
}
Block* const first_block{root.block};
Block* const first_block{root.data.block};
visited.insert(first_block);
block_stack.push_back(first_block);