Reactor: add Type* member to Value and remove vtable
This change removes the virtual getType() function, and instead stores
the Type* as a member in Variable. This change is important for when
materialize() gets called from Variable constructors, such as in LValue,
so that we do not call a virtual function from the constructor. Note
that this is exactly what would happen when LValue's ctor calls
materialize(), but it so happened that the most overridden getType() is
in LValue, so it calls the correct version. However, if we ever override
getType() in a class derived from LValue, this would fail to work
properly.
As getType was the only virtual function in Variable, note that the
sizeof(Variable) does not change as we swapped the one vtable pointer
for a Type pointer.
Bug: b/174160049
Change-Id: I8688fb9e9bd604e9839d3bac60761761bc969ae2
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50848
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by:
Antonio Maiorano <amaiorano@google.com>
Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
Showing
Please
register
or
sign in
to comment