Fix building with gcc.
This CL renames the Parameters using statement to ParametersList so it doesn't conflict with the Parameters method which is used later to return the ParametersList. Change-Id: I2ac19ba52fc0834e5a35b4b35a210dcc170866fc Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/41240 Auto-Submit: dan sinclair <dsinclair@chromium.org> Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
ab10db454b
commit
81302443f7
|
@ -1434,7 +1434,7 @@ semantic::Intrinsic* Impl::Overload::Match(ProgramBuilder& builder,
|
|||
assert(ret); // Build() must return a type
|
||||
|
||||
// Build the semantic parameters
|
||||
semantic::Parameters params;
|
||||
semantic::ParameterList params;
|
||||
params.reserve(parameters.size());
|
||||
for (size_t i = 0; i < args.size(); i++) {
|
||||
auto& parameter = parameters[i];
|
||||
|
|
|
@ -59,14 +59,14 @@ struct Parameter {
|
|||
/// @returns a string representation of the given parameter usage.
|
||||
const char* str(Parameter::Usage usage);
|
||||
|
||||
/// Parameters is a list of Parameter
|
||||
using Parameters = std::vector<Parameter>;
|
||||
/// ParameterList is a list of Parameter
|
||||
using ParameterList = std::vector<Parameter>;
|
||||
|
||||
/// @param parameters the list of parameters
|
||||
/// @param usage the parameter usage to find
|
||||
/// @returns the index of the parameter with the given usage, or -1 if no
|
||||
/// parameter with the given usage exists.
|
||||
int IndexOf(const Parameters& parameters, Parameter::Usage usage);
|
||||
int IndexOf(const ParameterList& parameters, Parameter::Usage usage);
|
||||
|
||||
/// CallTarget is the base for callable functions
|
||||
class CallTarget : public Castable<CallTarget, Node> {
|
||||
|
@ -74,7 +74,7 @@ class CallTarget : public Castable<CallTarget, Node> {
|
|||
/// Constructor
|
||||
/// @param return_type the return type of the call target
|
||||
/// @param parameters the parameters for the call target
|
||||
CallTarget(type::Type* return_type, const semantic::Parameters& parameters);
|
||||
CallTarget(type::Type* return_type, const ParameterList& parameters);
|
||||
|
||||
/// @return the return type of the call target
|
||||
type::Type* ReturnType() const { return return_type_; }
|
||||
|
@ -83,11 +83,11 @@ class CallTarget : public Castable<CallTarget, Node> {
|
|||
~CallTarget() override;
|
||||
|
||||
/// @return the parameters of the call target
|
||||
const Parameters& Parameters() const { return parameters_; }
|
||||
const ParameterList& Parameters() const { return parameters_; }
|
||||
|
||||
private:
|
||||
type::Type* const return_type_;
|
||||
semantic::Parameters const parameters_;
|
||||
ParameterList const parameters_;
|
||||
};
|
||||
|
||||
} // namespace semantic
|
||||
|
|
|
@ -152,7 +152,7 @@ class Intrinsic : public Castable<Intrinsic, CallTarget> {
|
|||
/// @param parameters the parameters for the intrinsic overload
|
||||
Intrinsic(IntrinsicType type,
|
||||
type::Type* return_type,
|
||||
const semantic::Parameters& parameters);
|
||||
const ParameterList& parameters);
|
||||
|
||||
/// Destructor
|
||||
~Intrinsic() override;
|
||||
|
|
|
@ -21,13 +21,12 @@ TINT_INSTANTIATE_CLASS_ID(tint::semantic::CallTarget);
|
|||
namespace tint {
|
||||
namespace semantic {
|
||||
|
||||
CallTarget::CallTarget(type::Type* return_type,
|
||||
const semantic::Parameters& parameters)
|
||||
CallTarget::CallTarget(type::Type* return_type, const ParameterList& parameters)
|
||||
: return_type_(return_type), parameters_(parameters) {}
|
||||
|
||||
CallTarget::~CallTarget() = default;
|
||||
|
||||
int IndexOf(const Parameters& parameters, Parameter::Usage usage) {
|
||||
int IndexOf(const ParameterList& parameters, Parameter::Usage usage) {
|
||||
for (size_t i = 0; i < parameters.size(); i++) {
|
||||
if (parameters[i].usage == usage) {
|
||||
return static_cast<int>(i);
|
||||
|
|
|
@ -33,8 +33,8 @@ namespace semantic {
|
|||
|
||||
namespace {
|
||||
|
||||
Parameters GetParameters(ast::Function* ast) {
|
||||
semantic::Parameters parameters;
|
||||
ParameterList GetParameters(ast::Function* ast) {
|
||||
ParameterList parameters;
|
||||
parameters.reserve(ast->params().size());
|
||||
for (auto* param : ast->params()) {
|
||||
parameters.emplace_back(Parameter{param->type(), Parameter::Usage::kNone});
|
||||
|
|
|
@ -240,7 +240,7 @@ bool IsDataPackingIntrinsic(IntrinsicType i) {
|
|||
|
||||
Intrinsic::Intrinsic(IntrinsicType type,
|
||||
type::Type* return_type,
|
||||
const semantic::Parameters& parameters)
|
||||
const ParameterList& parameters)
|
||||
: Base(return_type, parameters), type_(type) {}
|
||||
|
||||
Intrinsic::~Intrinsic() = default;
|
||||
|
|
|
@ -478,7 +478,7 @@ bool TypeDeterminer::DetermineIntrinsicCall(
|
|||
// checks on intrinsics is now almost entirely covered by the
|
||||
// IntrinsicTable, we should remove the Validator checks on intrinsic
|
||||
// signatures and remove these hacks.
|
||||
semantic::Parameters parameters;
|
||||
semantic::ParameterList parameters;
|
||||
parameters.reserve(arg_tys.size());
|
||||
for (auto* arg : arg_tys) {
|
||||
parameters.emplace_back(semantic::Parameter{arg});
|
||||
|
|
|
@ -2545,7 +2545,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
testing::ValuesIn(ast::intrinsic::test::TextureOverloadCase::ValidCases()));
|
||||
|
||||
std::string to_str(const std::string& function,
|
||||
const semantic::Parameters& params) {
|
||||
const semantic::ParameterList& params) {
|
||||
std::stringstream out;
|
||||
out << function << "(";
|
||||
bool first = true;
|
||||
|
|
Loading…
Reference in New Issue