mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 05:27:49 +00:00
ast: Remove types from ast::Literals
A literal has an implicit type, so there should be no type on the AST node. This highlighted that the resolver was nto canonicalizing TypeConstructorExpression types, which has been fixed. This required preservation of the declared type name in order for error messages to contain aliased names. Bug: tint:724 Change-Id: I21594a3e8a0fb1b73c6c5b46a14b8664b7f28512 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/49345 Reviewed-by: Antonio Maiorano <amaiorano@google.com> Commit-Queue: Ben Clayton <bclayton@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
0bf0fb9b29
commit
109b18f504
@@ -992,27 +992,19 @@ class ProgramBuilder {
|
||||
|
||||
/// @param val the boolan value
|
||||
/// @return a boolean literal with the given value
|
||||
ast::BoolLiteral* Literal(bool val) {
|
||||
return create<ast::BoolLiteral>(ty.bool_(), val);
|
||||
}
|
||||
ast::BoolLiteral* Literal(bool val) { return create<ast::BoolLiteral>(val); }
|
||||
|
||||
/// @param val the float value
|
||||
/// @return a float literal with the given value
|
||||
ast::FloatLiteral* Literal(f32 val) {
|
||||
return create<ast::FloatLiteral>(ty.f32(), val);
|
||||
}
|
||||
ast::FloatLiteral* Literal(f32 val) { return create<ast::FloatLiteral>(val); }
|
||||
|
||||
/// @param val the unsigned int value
|
||||
/// @return a ast::UintLiteral with the given value
|
||||
ast::UintLiteral* Literal(u32 val) {
|
||||
return create<ast::UintLiteral>(ty.u32(), val);
|
||||
}
|
||||
ast::UintLiteral* Literal(u32 val) { return create<ast::UintLiteral>(val); }
|
||||
|
||||
/// @param val the integer value
|
||||
/// @return the ast::SintLiteral with the given value
|
||||
ast::SintLiteral* Literal(i32 val) {
|
||||
return create<ast::SintLiteral>(ty.i32(), val);
|
||||
}
|
||||
ast::SintLiteral* Literal(i32 val) { return create<ast::SintLiteral>(val); }
|
||||
|
||||
/// @param args the arguments for the type constructor
|
||||
/// @return an `ast::TypeConstructorExpression` of type `ty`, with the values
|
||||
|
||||
Reference in New Issue
Block a user