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 |
|---|---|---|
| .vscode | Loading commit data... | |
| build | Loading commit data... | |
| docs | Loading commit data... | |
| extensions | Loading commit data... | |
| include | Loading commit data... | |
| src | Loading commit data... | |
| tests | Loading commit data... | |
| third_party | Loading commit data... | |
| .dir-locals.el | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .gitmodules | Loading commit data... | |
| .travis.yml | Loading commit data... | |
| AUTHORS.txt | Loading commit data... | |
| Android.bp | Loading commit data... | |
| Android.mk | Loading commit data... | |
| BUILD.gn | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| CONTRIBUTING.txt | Loading commit data... | |
| CONTRIBUTORS.txt | Loading commit data... | |
| LICENSE.txt | Loading commit data... | |
| OWNERS | Loading commit data... | |
| README.md | Loading commit data... | |
| SwiftShader.sln | Loading commit data... |