From 3c20dd515e74e936d3c11db62dee177e01f4f75e Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 30 Apr 2022 21:58:41 +0900 Subject: [PATCH] Revert "Don't bother creating an alias for a def of the same type." This reverts commit 2904c619c1b883a29c2b7ea29210b44ee8f298f0. In order to support swizzle operations, I need to be able to alias defs to larger types (eg, float to vec4), but alias_def rightly won't allow this. However, as the plan is to do this in the final steps before emitting the instruction, I plan on creating an alias to a float then adjusting the type in the alias, but to do so without extra shenanigans, I need alias_def to allow aliases to the same type. As a fringe benefit, it makes the code agree with the comment in def.h :P --- tools/qfcc/source/def.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/qfcc/source/def.c b/tools/qfcc/source/def.c index 8e009cb85..bab482a9f 100644 --- a/tools/qfcc/source/def.c +++ b/tools/qfcc/source/def.c @@ -180,8 +180,6 @@ alias_def (def_t *def, type_t *type, int offset) internal_error (0, "aliasing a def to a larger type"); if (offset < 0 || offset + type_size (type) > type_size (def->type)) internal_error (0, "invalid alias offset"); - if (type == def->type) - return def; for (alias = def->alias_defs; alias; alias = alias->next) { if (alias->type == type && alias->offset == offset) return alias;