mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-12 06:45:16 +00:00
ast: Use IdentifierExpression for call targets
They are always identifiers, and this removes unnecessary type casting from usages of CallExpression::func(). Change-Id: I7a11dc10658abab578395e20ad830cd5bc5a5b71 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/51960 Auto-Submit: James Price <jrprice@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
e5fdd58352
commit
28ec968b4f
@@ -23,7 +23,7 @@ namespace ast {
|
||||
|
||||
CallExpression::CallExpression(ProgramID program_id,
|
||||
const Source& source,
|
||||
Expression* func,
|
||||
IdentifierExpression* func,
|
||||
ExpressionList params)
|
||||
: Base(program_id, source), func_(func), params_(params) {
|
||||
TINT_ASSERT(func_);
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
namespace tint {
|
||||
namespace ast {
|
||||
|
||||
// Forward declarations.
|
||||
class IdentifierExpression;
|
||||
|
||||
/// A call expression
|
||||
class CallExpression : public Castable<CallExpression, Expression> {
|
||||
public:
|
||||
@@ -30,14 +33,14 @@ class CallExpression : public Castable<CallExpression, Expression> {
|
||||
/// @param params the parameters
|
||||
CallExpression(ProgramID program_id,
|
||||
const Source& source,
|
||||
Expression* func,
|
||||
IdentifierExpression* func,
|
||||
ExpressionList params);
|
||||
/// Move constructor
|
||||
CallExpression(CallExpression&&);
|
||||
~CallExpression() override;
|
||||
|
||||
/// @returns the func
|
||||
Expression* func() const { return func_; }
|
||||
IdentifierExpression* func() const { return func_; }
|
||||
/// @returns the parameters
|
||||
const ExpressionList& params() const { return params_; }
|
||||
|
||||
@@ -58,7 +61,7 @@ class CallExpression : public Castable<CallExpression, Expression> {
|
||||
private:
|
||||
CallExpression(const CallExpression&) = delete;
|
||||
|
||||
Expression* const func_;
|
||||
IdentifierExpression* const func_;
|
||||
ExpressionList const params_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user