ast: Add 'Expression' suffix to literals

Literals are now expressions, so in keeping with all the other
expression types, suffix the class name with Expression.

I'm not overly keen on requiring everything to have an Expression
suffix, but consistency is better than personal preference.

Bug: tint:888
Change-Id: Ida1f1b98c71d5d0fe6399bca938010cd5d3a00c3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/68840
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
Ben Clayton 2021-11-09 09:35:00 +00:00 committed by Ben Clayton
parent 575c4efe2f
commit 30848b6594
27 changed files with 82 additions and 82 deletions

View File

@ -196,8 +196,8 @@ libtint_source_set("libtint_core_all_src") {
"ast/block_statement.h",
"ast/bool.cc",
"ast/bool.h",
"ast/bool_literal.cc",
"ast/bool_literal.h",
"ast/bool_literal_expression.cc",
"ast/bool_literal_expression.h",
"ast/break_statement.cc",
"ast/break_statement.h",
"ast/builtin.cc",
@ -234,8 +234,8 @@ libtint_source_set("libtint_core_all_src") {
"ast/f32.h",
"ast/fallthrough_statement.cc",
"ast/fallthrough_statement.h",
"ast/float_literal.cc",
"ast/float_literal.h",
"ast/float_literal_expression.cc",
"ast/float_literal_expression.h",
"ast/for_loop_statement.cc",
"ast/for_loop_statement.h",
"ast/function.cc",
@ -248,16 +248,16 @@ libtint_source_set("libtint_core_all_src") {
"ast/identifier_expression.h",
"ast/if_statement.cc",
"ast/if_statement.h",
"ast/int_literal.cc",
"ast/int_literal.h",
"ast/int_literal_expression.cc",
"ast/int_literal_expression.h",
"ast/internal_decoration.cc",
"ast/internal_decoration.h",
"ast/interpolate_decoration.cc",
"ast/interpolate_decoration.h",
"ast/invariant_decoration.cc",
"ast/invariant_decoration.h",
"ast/literal.cc",
"ast/literal.h",
"ast/literal_expression.cc",
"ast/literal_expression.h",
"ast/location_decoration.cc",
"ast/location_decoration.h",
"ast/loop_statement.cc",
@ -286,8 +286,8 @@ libtint_source_set("libtint_core_all_src") {
"ast/sampled_texture.h",
"ast/sampler.cc",
"ast/sampler.h",
"ast/sint_literal.cc",
"ast/sint_literal.h",
"ast/sint_literal_expression.cc",
"ast/sint_literal_expression.h",
"ast/stage_decoration.cc",
"ast/stage_decoration.h",
"ast/statement.cc",
@ -324,8 +324,8 @@ libtint_source_set("libtint_core_all_src") {
"ast/type_name.h",
"ast/u32.cc",
"ast/u32.h",
"ast/uint_literal.cc",
"ast/uint_literal.h",
"ast/uint_literal_expression.cc",
"ast/uint_literal_expression.h",
"ast/unary_op.cc",
"ast/unary_op.h",
"ast/unary_op_expression.cc",

View File

@ -58,8 +58,8 @@ set(TINT_LIB_SRCS
ast/bitcast_expression.h
ast/block_statement.cc
ast/block_statement.h
ast/bool_literal.cc
ast/bool_literal.h
ast/bool_literal_expression.cc
ast/bool_literal_expression.h
ast/bool.cc
ast/bool.h
ast/break_statement.cc
@ -98,8 +98,8 @@ set(TINT_LIB_SRCS
ast/f32.h
ast/fallthrough_statement.cc
ast/fallthrough_statement.h
ast/float_literal.cc
ast/float_literal.h
ast/float_literal_expression.cc
ast/float_literal_expression.h
ast/for_loop_statement.cc
ast/for_loop_statement.h
ast/function.cc
@ -112,16 +112,16 @@ set(TINT_LIB_SRCS
ast/identifier_expression.h
ast/if_statement.cc
ast/if_statement.h
ast/int_literal.cc
ast/int_literal.h
ast/int_literal_expression.cc
ast/int_literal_expression.h
ast/internal_decoration.cc
ast/internal_decoration.h
ast/interpolate_decoration.cc
ast/interpolate_decoration.h
ast/invariant_decoration.cc
ast/invariant_decoration.h
ast/literal.cc
ast/literal.h
ast/literal_expression.cc
ast/literal_expression.h
ast/location_decoration.cc
ast/location_decoration.h
ast/loop_statement.cc
@ -150,8 +150,8 @@ set(TINT_LIB_SRCS
ast/sampled_texture.h
ast/sampler.cc
ast/sampler.h
ast/sint_literal.cc
ast/sint_literal.h
ast/sint_literal_expression.cc
ast/sint_literal_expression.h
ast/stage_decoration.cc
ast/stage_decoration.h
ast/statement.cc
@ -191,8 +191,8 @@ set(TINT_LIB_SRCS
ast/type_name.h
ast/u32.cc
ast/u32.h
ast/uint_literal.cc
ast/uint_literal.h
ast/uint_literal_expression.cc
ast/uint_literal_expression.h
ast/unary_op_expression.cc
ast/unary_op_expression.h
ast/unary_op.cc
@ -589,7 +589,7 @@ if(${TINT_BUILD_TESTS})
ast/binding_decoration_test.cc
ast/bitcast_expression_test.cc
ast/block_statement_test.cc
ast/bool_literal_test.cc
ast/bool_literal_expression_test.cc
ast/bool_test.cc
ast/break_statement_test.cc
ast/builtin_decoration_test.cc
@ -604,14 +604,14 @@ if(${TINT_BUILD_TESTS})
ast/external_texture_test.cc
ast/f32_test.cc
ast/fallthrough_statement_test.cc
ast/float_literal_test.cc
ast/float_literal_expression_test.cc
ast/for_loop_statement_test.cc
ast/function_test.cc
ast/group_decoration_test.cc
ast/i32_test.cc
ast/identifier_expression_test.cc
ast/if_statement_test.cc
ast/int_literal_test.cc
ast/int_literal_expression_test.cc
ast/interpolate_decoration_test.cc
ast/intrinsic_texture_helper_test.cc
ast/intrinsic_texture_helper_test.h
@ -629,7 +629,7 @@ if(${TINT_BUILD_TESTS})
ast/return_statement_test.cc
ast/sampled_texture_test.cc
ast/sampler_test.cc
ast/sint_literal_test.cc
ast/sint_literal_expression_test.cc
ast/stage_decoration_test.cc
ast/storage_texture_test.cc
ast/stride_decoration_test.cc
@ -644,7 +644,7 @@ if(${TINT_BUILD_TESTS})
ast/traverse_expressions_test.cc
ast/type_constructor_expression_test.cc
ast/u32_test.cc
ast/uint_literal_test.cc
ast/uint_literal_expression_test.cc
ast/unary_op_expression_test.cc
ast/variable_decl_statement_test.cc
ast/variable_test.cc

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/ast/bool_literal.h"
#include "src/ast/bool_literal_expression.h"
#include "src/program_builder.h"

View File

@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SRC_AST_BOOL_LITERAL_H_
#define SRC_AST_BOOL_LITERAL_H_
#ifndef SRC_AST_BOOL_LITERAL_EXPRESSION_H_
#define SRC_AST_BOOL_LITERAL_EXPRESSION_H_
#include <string>
#include "src/ast/literal.h"
#include "src/ast/literal_expression.h"
namespace tint {
namespace ast {
@ -45,4 +45,4 @@ class BoolLiteral : public Castable<BoolLiteral, Literal> {
} // namespace ast
} // namespace tint
#endif // SRC_AST_BOOL_LITERAL_H_
#endif // SRC_AST_BOOL_LITERAL_EXPRESSION_H_

View File

@ -18,7 +18,7 @@
#include <vector>
#include "src/ast/block_statement.h"
#include "src/ast/int_literal.h"
#include "src/ast/int_literal_expression.h"
namespace tint {
namespace ast {

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/ast/float_literal.h"
#include "src/ast/float_literal_expression.h"
#include <limits>

View File

@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SRC_AST_FLOAT_LITERAL_H_
#define SRC_AST_FLOAT_LITERAL_H_
#ifndef SRC_AST_FLOAT_LITERAL_EXPRESSION_H_
#define SRC_AST_FLOAT_LITERAL_EXPRESSION_H_
#include <string>
#include "src/ast/literal.h"
#include "src/ast/literal_expression.h"
namespace tint {
namespace ast {
@ -45,4 +45,4 @@ class FloatLiteral : public Castable<FloatLiteral, Literal> {
} // namespace ast
} // namespace tint
#endif // SRC_AST_FLOAT_LITERAL_H_
#endif // SRC_AST_FLOAT_LITERAL_EXPRESSION_H_

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/ast/int_literal.h"
#include "src/ast/int_literal_expression.h"
TINT_INSTANTIATE_TYPEINFO(tint::ast::IntLiteral);

View File

@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SRC_AST_INT_LITERAL_H_
#define SRC_AST_INT_LITERAL_H_
#ifndef SRC_AST_INT_LITERAL_EXPRESSION_H_
#define SRC_AST_INT_LITERAL_EXPRESSION_H_
#include "src/ast/literal.h"
#include "src/ast/literal_expression.h"
namespace tint {
namespace ast {
@ -41,4 +41,4 @@ class IntLiteral : public Castable<IntLiteral, Literal> {
} // namespace ast
} // namespace tint
#endif // SRC_AST_INT_LITERAL_H_
#endif // SRC_AST_INT_LITERAL_EXPRESSION_H_

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/ast/literal.h"
#include "src/ast/literal_expression.h"
TINT_INSTANTIATE_TYPEINFO(tint::ast::Literal);

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SRC_AST_LITERAL_H_
#define SRC_AST_LITERAL_H_
#ifndef SRC_AST_LITERAL_EXPRESSION_H_
#define SRC_AST_LITERAL_EXPRESSION_H_
#include <string>
@ -37,4 +37,4 @@ class Literal : public Castable<Literal, Expression> {
} // namespace ast
} // namespace tint
#endif // SRC_AST_LITERAL_H_
#endif // SRC_AST_LITERAL_EXPRESSION_H_

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/ast/sint_literal.h"
#include "src/ast/sint_literal_expression.h"
#include "src/program_builder.h"

View File

@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SRC_AST_SINT_LITERAL_H_
#define SRC_AST_SINT_LITERAL_H_
#ifndef SRC_AST_SINT_LITERAL_EXPRESSION_H_
#define SRC_AST_SINT_LITERAL_EXPRESSION_H_
#include <string>
#include "src/ast/int_literal.h"
#include "src/ast/int_literal_expression.h"
namespace tint {
namespace ast {
@ -48,4 +48,4 @@ class SintLiteral : public Castable<SintLiteral, IntLiteral> {
} // namespace ast
} // namespace tint
#endif // SRC_AST_SINT_LITERAL_H_
#endif // SRC_AST_SINT_LITERAL_EXPRESSION_H_

View File

@ -21,7 +21,7 @@
#include "src/ast/binary_expression.h"
#include "src/ast/bitcast_expression.h"
#include "src/ast/call_expression.h"
#include "src/ast/literal.h"
#include "src/ast/literal_expression.h"
#include "src/ast/member_accessor_expression.h"
#include "src/ast/phony_expression.h"
#include "src/ast/type_constructor_expression.h"

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/ast/uint_literal.h"
#include "src/ast/uint_literal_expression.h"
#include "src/program_builder.h"

View File

@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SRC_AST_UINT_LITERAL_H_
#define SRC_AST_UINT_LITERAL_H_
#ifndef SRC_AST_UINT_LITERAL_EXPRESSION_H_
#define SRC_AST_UINT_LITERAL_EXPRESSION_H_
#include <string>
#include "src/ast/int_literal.h"
#include "src/ast/int_literal_expression.h"
namespace tint {
namespace ast {
@ -48,4 +48,4 @@ class UintLiteral : public Castable<UintLiteral, IntLiteral> {
} // namespace ast
} // namespace tint
#endif // SRC_AST_UINT_LITERAL_H_
#endif // SRC_AST_UINT_LITERAL_EXPRESSION_H_

View File

@ -17,15 +17,15 @@
#include <limits>
#include <utility>
#include "src/ast/bool_literal.h"
#include "src/ast/bool_literal_expression.h"
#include "src/ast/call_expression.h"
#include "src/ast/float_literal.h"
#include "src/ast/float_literal_expression.h"
#include "src/ast/interpolate_decoration.h"
#include "src/ast/location_decoration.h"
#include "src/ast/module.h"
#include "src/ast/override_decoration.h"
#include "src/ast/sint_literal.h"
#include "src/ast/uint_literal.h"
#include "src/ast/sint_literal_expression.h"
#include "src/ast/uint_literal_expression.h"
#include "src/sem/array.h"
#include "src/sem/call.h"
#include "src/sem/depth_multisampled_texture_type.h"

View File

@ -28,7 +28,7 @@
#include "src/ast/binding_decoration.h"
#include "src/ast/bitcast_expression.h"
#include "src/ast/bool.h"
#include "src/ast/bool_literal.h"
#include "src/ast/bool_literal_expression.h"
#include "src/ast/break_statement.h"
#include "src/ast/call_expression.h"
#include "src/ast/call_statement.h"
@ -38,7 +38,7 @@
#include "src/ast/disable_validation_decoration.h"
#include "src/ast/external_texture.h"
#include "src/ast/f32.h"
#include "src/ast/float_literal.h"
#include "src/ast/float_literal_expression.h"
#include "src/ast/for_loop_statement.h"
#include "src/ast/i32.h"
#include "src/ast/if_statement.h"
@ -55,7 +55,7 @@
#include "src/ast/return_statement.h"
#include "src/ast/sampled_texture.h"
#include "src/ast/sampler.h"
#include "src/ast/sint_literal.h"
#include "src/ast/sint_literal_expression.h"
#include "src/ast/stage_decoration.h"
#include "src/ast/storage_texture.h"
#include "src/ast/stride_decoration.h"
@ -67,7 +67,7 @@
#include "src/ast/type_constructor_expression.h"
#include "src/ast/type_name.h"
#include "src/ast/u32.h"
#include "src/ast/uint_literal.h"
#include "src/ast/uint_literal_expression.h"
#include "src/ast/unary_op_expression.h"
#include "src/ast/variable_decl_statement.h"
#include "src/ast/vector.h"

View File

@ -23,7 +23,7 @@
#include "src/ast/break_statement.h"
#include "src/ast/call_statement.h"
#include "src/ast/continue_statement.h"
#include "src/ast/float_literal.h"
#include "src/ast/float_literal_expression.h"
#include "src/ast/if_statement.h"
#include "src/ast/intrinsic_texture_helper_test.h"
#include "src/ast/loop_statement.h"

View File

@ -22,16 +22,16 @@
#include <vector>
#include "src/ast/alias.h"
#include "src/ast/bool_literal.h"
#include "src/ast/bool_literal_expression.h"
#include "src/ast/call_statement.h"
#include "src/ast/disable_validation_decoration.h"
#include "src/ast/fallthrough_statement.h"
#include "src/ast/float_literal.h"
#include "src/ast/float_literal_expression.h"
#include "src/ast/interpolate_decoration.h"
#include "src/ast/module.h"
#include "src/ast/override_decoration.h"
#include "src/ast/sint_literal.h"
#include "src/ast/uint_literal.h"
#include "src/ast/sint_literal_expression.h"
#include "src/ast/uint_literal_expression.h"
#include "src/ast/variable_decl_statement.h"
#include "src/ast/void.h"
#include "src/sem/array.h"

View File

@ -21,12 +21,12 @@
#include "src/ast/array.h"
#include "src/ast/atomic.h"
#include "src/ast/bool.h"
#include "src/ast/bool_literal.h"
#include "src/ast/bool_literal_expression.h"
#include "src/ast/call_statement.h"
#include "src/ast/depth_texture.h"
#include "src/ast/external_texture.h"
#include "src/ast/f32.h"
#include "src/ast/float_literal.h"
#include "src/ast/float_literal_expression.h"
#include "src/ast/i32.h"
#include "src/ast/internal_decoration.h"
#include "src/ast/interpolate_decoration.h"
@ -37,7 +37,7 @@
#include "src/ast/override_decoration.h"
#include "src/ast/pointer.h"
#include "src/ast/sampled_texture.h"
#include "src/ast/sint_literal.h"
#include "src/ast/sint_literal_expression.h"
#include "src/ast/stage_decoration.h"
#include "src/ast/storage_texture.h"
#include "src/ast/stride_decoration.h"
@ -47,7 +47,7 @@
#include "src/ast/struct_member_size_decoration.h"
#include "src/ast/type_name.h"
#include "src/ast/u32.h"
#include "src/ast/uint_literal.h"
#include "src/ast/uint_literal_expression.h"
#include "src/ast/variable_decl_statement.h"
#include "src/ast/vector.h"
#include "src/ast/void.h"

View File

@ -154,7 +154,7 @@ tint_unittests_source_set("tint_unittests_core_src") {
"../src/ast/binding_decoration_test.cc",
"../src/ast/bitcast_expression_test.cc",
"../src/ast/block_statement_test.cc",
"../src/ast/bool_literal_test.cc",
"../src/ast/bool_literal_expression_test.cc",
"../src/ast/bool_test.cc",
"../src/ast/break_statement_test.cc",
"../src/ast/builtin_decoration_test.cc",
@ -169,14 +169,14 @@ tint_unittests_source_set("tint_unittests_core_src") {
"../src/ast/external_texture_test.cc",
"../src/ast/f32_test.cc",
"../src/ast/fallthrough_statement_test.cc",
"../src/ast/float_literal_test.cc",
"../src/ast/float_literal_expression_test.cc",
"../src/ast/for_loop_statement_test.cc",
"../src/ast/function_test.cc",
"../src/ast/group_decoration_test.cc",
"../src/ast/i32_test.cc",
"../src/ast/identifier_expression_test.cc",
"../src/ast/if_statement_test.cc",
"../src/ast/int_literal_test.cc",
"../src/ast/int_literal_expression_test.cc",
"../src/ast/interpolate_decoration_test.cc",
"../src/ast/intrinsic_texture_helper_test.cc",
"../src/ast/intrinsic_texture_helper_test.h",
@ -194,7 +194,7 @@ tint_unittests_source_set("tint_unittests_core_src") {
"../src/ast/return_statement_test.cc",
"../src/ast/sampled_texture_test.cc",
"../src/ast/sampler_test.cc",
"../src/ast/sint_literal_test.cc",
"../src/ast/sint_literal_expression_test.cc",
"../src/ast/stage_decoration_test.cc",
"../src/ast/storage_texture_test.cc",
"../src/ast/stride_decoration_test.cc",
@ -209,7 +209,7 @@ tint_unittests_source_set("tint_unittests_core_src") {
"../src/ast/traverse_expressions_test.cc",
"../src/ast/type_constructor_expression_test.cc",
"../src/ast/u32_test.cc",
"../src/ast/uint_literal_test.cc",
"../src/ast/uint_literal_expression_test.cc",
"../src/ast/unary_op_expression_test.cc",
"../src/ast/variable_decl_statement_test.cc",
"../src/ast/variable_test.cc",