#include "src/tint/lang/core/intrinsic/table.h"
#include <algorithm>
#include <limits>
#include <ostream>
#include <utility>
#include "src/tint/lang/core/evaluation_stage.h"
#include "src/tint/lang/core/intrinsic/table_data.h"
#include "src/tint/lang/core/type/invalid.h"
#include "src/tint/lang/core/type/manager.h"
#include "src/tint/lang/core/type/void.h"
#include "src/tint/utils/containers/slice.h"
#include "src/tint/utils/ice/ice.h"
#include "src/tint/utils/macros/defer.h"
#include "src/tint/utils/text/string_stream.h"
#include "src/tint/utils/text/styled_text.h"
#include "src/tint/utils/text/text_style.h"
namespace tint::core::intrinsic {
const Number Number::any{ … };
const Number Number::invalid{ … };
Any::Any() : … { … }
Any::~Any() = default;
bool Any::Equals(const core::type::UniqueNode&) const { … }
std::string Any::FriendlyName() const { … }
core::type::Type* Any::Clone(core::type::CloneContext&) const { … }
namespace {
constexpr const size_t kNumFixedParameters = …;
constexpr const size_t kNumFixedCandidates = …;
Candidates;
OnNoMatch;
static inline void SortCandidates(Candidates& candidates) { … }
static void PrintTypeList(StyledText& ss, VectorRef<const core::type::Type*> types) { … }
Result<Overload, StyledText> MatchIntrinsic(Context& context,
const IntrinsicInfo& intrinsic,
std::string_view intrinsic_name,
VectorRef<const core::type::Type*> template_args,
VectorRef<const core::type::Type*> args,
EvaluationStage earliest_eval_stage,
bool member_function,
const OnNoMatch& on_no_match);
enum class ScoreMode { … };
template <ScoreMode MODE>
Candidate ScoreOverload(Context& context,
const OverloadInfo& overload,
VectorRef<const core::type::Type*> template_args,
VectorRef<const core::type::Type*> args,
EvaluationStage earliest_eval_stage);
Result<Candidate, StyledText> ResolveCandidate(Context& context,
Candidates&& candidates,
std::string_view intrinsic_name,
VectorRef<const core::type::Type*> template_args,
VectorRef<const core::type::Type*> args);
void PrintCandidates(StyledText& err,
Context& context,
VectorRef<Candidate> candidates,
std::string_view intrinsic_name,
VectorRef<const core::type::Type*> template_args,
VectorRef<const core::type::Type*> args);
StyledText ErrAmbiguousOverload(Context& context,
std::string_view intrinsic_name,
VectorRef<const core::type::Type*> template_args,
VectorRef<const core::type::Type*> args,
VectorRef<Candidate> candidates);
StyledText CallSignature(std::string_view intrinsic_name,
VectorRef<const core::type::Type*> template_args,
VectorRef<const core::type::Type*> args) { … }
Result<Overload, StyledText> MatchIntrinsic(Context& context,
const IntrinsicInfo& intrinsic,
std::string_view intrinsic_name,
VectorRef<const core::type::Type*> template_args,
VectorRef<const core::type::Type*> args,
EvaluationStage earliest_eval_stage,
bool member_function,
const OnNoMatch& on_no_match) { … }
template <ScoreMode MODE>
Candidate ScoreOverload(Context& context,
const OverloadInfo& overload,
VectorRef<const core::type::Type*> template_args,
VectorRef<const core::type::Type*> args,
EvaluationStage earliest_eval_stage) { … }
Result<Candidate, StyledText> ResolveCandidate(Context& context,
Candidates&& candidates,
std::string_view intrinsic_name,
VectorRef<const core::type::Type*> template_args,
VectorRef<const core::type::Type*> args) { … }
void PrintCandidates(StyledText& ss,
Context& context,
VectorRef<Candidate> candidates,
std::string_view intrinsic_name,
VectorRef<const core::type::Type*> template_args,
VectorRef<const core::type::Type*> args) { … }
StyledText ErrAmbiguousOverload(Context& context,
std::string_view intrinsic_name,
VectorRef<const core::type::Type*> template_args,
VectorRef<const core::type::Type*> args,
VectorRef<Candidate> candidates) { … }
}
void PrintCandidate(StyledText& ss,
Context& context,
const Candidate& candidate,
std::string_view intrinsic_name,
VectorRef<const core::type::Type*> template_args,
VectorRef<const core::type::Type*> args) { … }
Result<Overload, StyledText> LookupFn(Context& context,
std::string_view intrinsic_name,
size_t function_id,
VectorRef<const core::type::Type*> template_args,
VectorRef<const core::type::Type*> args,
EvaluationStage earliest_eval_stage) { … }
Result<Overload, StyledText> LookupMemberFn(Context& context,
std::string_view intrinsic_name,
size_t function_id,
VectorRef<const core::type::Type*> template_args,
VectorRef<const core::type::Type*> args,
EvaluationStage earliest_eval_stage) { … }
Result<Overload, StyledText> LookupUnary(Context& context,
core::UnaryOp op,
const core::type::Type* arg,
EvaluationStage earliest_eval_stage) { … }
Result<Overload, StyledText> LookupBinary(Context& context,
core::BinaryOp op,
const core::type::Type* lhs,
const core::type::Type* rhs,
EvaluationStage earliest_eval_stage,
bool is_compound) { … }
Result<Overload, StyledText> LookupCtorConv(Context& context,
std::string_view type_name,
size_t type_id,
VectorRef<const core::type::Type*> template_args,
VectorRef<const core::type::Type*> args,
EvaluationStage earliest_eval_stage) { … }
}
TINT_INSTANTIATE_TYPEINFO(…);