Commit Graph

8 Commits

Author SHA1 Message Date
dan sinclair 46c32d882d Early out Is checks.
This CL adds a check to the `Is` castable methods to determine if the
target type is `final`. If the type being compared too is `final` we
bail out early in the walk up the hierarchy as it won't be a parent
class.

Change-Id: Ieba4dd686e47207a3db0cf3a8ea46fbc1a8d1c91
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96600
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-07-20 15:53:14 +00:00
dan sinclair 3a2a279714 Fixup various warnings in Tint which were accidentally suppressed.
When enabling the SPIR-V reader or SPIR-V writer we were suppressing
-Wnewline-eof, -Wold-style-cast, -Wsign-conversion, and -Wweak-vtables
for the `libtint` cmake target and anything that depended on that
target. Because we'd build all readers/ writers by default this caused
us to never hit those warnings.

A recent change to the cmake build sets the Tint backend based on
the Dawn backend. So, there is a much higher chance of not building
the SPIR-V support if you're on a Mac or Windows machine.

This CL removes the suppression of the warnings, adds specific pragmas
into the SPIR-V reader code which imports the SPIRV-Tools headers
and fixes up the warnings which were then firing due to checking
for the new warnings.

Change-Id: I0d0be6aa3d0b692e939ce8ff924dfb82c82792fc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94901
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-06-29 14:38:15 +00:00
Ben Clayton f7357f89a3 tint: Castable - support non-default-constructable return types
If the Switch() has a default case, then allow support for return types that do not have a default constructor.

Bug: tint:1504
Change-Id: I671ea78fe976138a786e2e0472e1e5f99afa0c5d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89022
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
2022-05-05 19:18:00 +00:00
dan sinclair 41e4d9a34c Consistent formatting for Dawn/Tint.
This CL updates the clang format files to have a single shared format
between Dawn and Tint. The major changes are tabs are 4 spaces, lines
are 100 columns and namespaces are not indented.

Bug: dawn:1339
Change-Id: I4208742c95643998d9fd14e77a9cc558071ded39
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87603
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-01 14:40:55 +00:00
Ben Clayton a7230f06ff tint: Standardize the way we forward-declare
Style guide has been updated to describe the style in use.

Change-Id: I3fc08e3440566106582695f4dc149fa67d8b8dc8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86303
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-04-11 14:37:21 +00:00
Zhaoming Jiang 4bc30b7ba2 Fix default case must at last assertion in Switch()
Fix an assertion in SwitchCases that default case must be last in Switch().

Change-Id: I5ece5a20e22f8df607581373d1f0bb0bd44fb58b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/85461
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
2022-04-01 11:12:36 +00:00
Ben Clayton f33f1b41ff castable: Make Switch() smarter about return types
Infer the return type by finding the common type across all cases.
Types that derive from CastableBase will automatically infer to
the common base class.

Change-Id: I2112ca1abae34e55396685e9ebf2da12f8a6e3fc
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80320
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
2022-02-25 20:24:42 +00:00
Ryan Harrison dbc13af287 tint->dawn: Shuffle source tree in preperation of merging repos
docs/    -> docs/tint/
fuzzers/ -> src/tint/fuzzers/
samples/ -> src/tint/cmd/
src/     -> src/tint/
test/    -> test/tint/

BUG=tint:1418,tint:1433

Change-Id: Id2aa79f989aef3245b80ef4aa37a27ff16cd700b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80482
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2022-02-21 15:19:07 +00:00