Reactor: Add self() method to LValue<T> and Array<T>

As LValue<T> overloads operator&(), there's no sensible way to get the address of the reactor type.

This is handy for storing a pointer to an Array or LValue in a field.

Bug: b/133213304
Change-Id: I950ee312005bc57187129f009578b8715973804a
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/33357
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Reactor/Reactor.hpp b/src/Reactor/Reactor.hpp
index d269fec..61af2d0 100644
--- a/src/Reactor/Reactor.hpp
+++ b/src/Reactor/Reactor.hpp
@@ -157,6 +157,10 @@
 		{
 			return false;
 		}
+
+		// self() returns the this pointer to this LValue<T> object.
+		// This function exists because operator&() is overloaded.
+		inline LValue<T>* self() { return this; }
 	};
 
 	template<class T>
@@ -2448,6 +2452,10 @@
 		Reference<T> operator[](unsigned int index);
 		Reference<T> operator[](RValue<Int> index);
 		Reference<T> operator[](RValue<UInt> index);
+
+		// self() returns the this pointer to this Array object.
+		// This function exists because operator&() is overloaded by LValue<T>.
+		inline Array* self() { return this; }
 	};
 
 //	RValue<Array<T>> operator++(Array<T> &val, int);   // Post-increment