Provides a number of template trait types for Reactor primitive types: CToReactorT<T> transforms the C-type (T) into a suitable Reactor equivalent. Pointer types are now generalized, allowing for translations of T** types. IsRValue<T>::value and IsLValue<T>::value are true iff T is of the respective Reactor type. ReactorType<T> resolves to the corresponding LValue Reactor type for T, where T can be a C-type, RValue or LValue. ValueOf<T> returns a rr::Value* for a C-value, RValue or LValue. This is now used by a single definition of Return(), fixing bad type coercion which in turn produced illegal LLVM IR. CanBeUsedAsReturn<T>::value is true iff T can be used as a function return type. CanBeUsedAsParameter<T>::value is true iff T can be used as a function parameter type. Function signatures are now statically checked that all parameter types and the return type are valid, providing a human readable error message if an invalid type is used (verified on gcc, clang and msvc). Added a whole bunch of static asserts in ReactorUnitTests.cpp to sanity check the templates. Bug: b/131914569 Change-Id: I3267354d6a3f68545079365a657757969ec0047d Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/30455 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by:Ben Clayton <bclayton@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| SubmoduleCheck/gtest | Loading commit data... | |
| Android.mk | Loading commit data... | |
| BUILD.gn | Loading commit data... | |
| CPUID.cpp | Loading commit data... | |
| CPUID.hpp | Loading commit data... | |
| Debug.cpp | Loading commit data... | |
| Debug.hpp | Loading commit data... | |
| DebugAndroid.cpp | Loading commit data... | |
| DebugAndroid.hpp | Loading commit data... | |
| ExecutableMemory.cpp | Loading commit data... | |
| ExecutableMemory.hpp | Loading commit data... | |
| LLVMReactor.cpp | Loading commit data... | |
| LLVMReactor.hpp | Loading commit data... | |
| LLVMReactorDebugInfo.cpp | Loading commit data... | |
| LLVMReactorDebugInfo.hpp | Loading commit data... | |
| LLVMRoutine.cpp | Loading commit data... | |
| LLVMRoutine.hpp | Loading commit data... | |
| MutexLock.hpp | Loading commit data... | |
| Nucleus.hpp | Loading commit data... | |
| Optimizer.cpp | Loading commit data... | |
| Optimizer.hpp | Loading commit data... | |
| Reactor.cpp | Loading commit data... | |
| Reactor.hpp | Loading commit data... | |
| Reactor.vcxproj | Loading commit data... | |
| Reactor.vcxproj.filters | Loading commit data... | |
| ReactorUnitTests.cpp | Loading commit data... | |
| ReactorUnitTests.vcxproj | Loading commit data... | |
| ReactorUnitTests.vcxproj.filters | Loading commit data... | |
| ReactorUnitTests.vcxproj.user | Loading commit data... | |
| Routine.cpp | Loading commit data... | |
| Routine.hpp | Loading commit data... | |
| Subzero.vcxproj | Loading commit data... | |
| Subzero.vcxproj.filters | Loading commit data... | |
| SubzeroLLVMDependencies.vcxproj | Loading commit data... | |
| SubzeroLLVMDependencies.vcxproj.filters | Loading commit data... | |
| SubzeroReactor.cpp | Loading commit data... | |
| Thread.cpp | Loading commit data... | |
| Thread.hpp | Loading commit data... | |
| Traits.hpp | Loading commit data... | |
| x86.hpp | Loading commit data... |