libexpr: remove Value::determinePos

it was mostly useless, and now it's entirely unused.

Change-Id: I015c83779a7f860e325796684639f05083a50676
This commit is contained in:
eldritch horrors
2025-04-27 17:38:57 +00:00
parent c068aeaf61
commit dad17a54f7
4 changed files with 0 additions and 24 deletions
-6
View File
@@ -19,12 +19,6 @@ EvalErrorBuilder<T> EvalErrorBuilder<T>::atPos(PosIdx pos) &&
return std::move(*this);
}
template<std::derived_from<EvalError> T>
EvalErrorBuilder<T> EvalErrorBuilder<T>::atPos(Value & value, PosIdx fallback) &&
{
return std::move(*this).atPos(value.determinePos(fallback));
}
template<std::derived_from<EvalError> T>
EvalErrorBuilder<T> EvalErrorBuilder<T>::withTrace(PosIdx pos, const std::string_view text) &&
{
-2
View File
@@ -76,8 +76,6 @@ public:
[[gnu::noinline]] EvalErrorBuilder<T> atPos(PosIdx pos) &&;
[[gnu::noinline]] EvalErrorBuilder<T> atPos(Value & value, PosIdx fallback = noPos) &&;
[[gnu::noinline]] EvalErrorBuilder<T> withTrace(PosIdx pos, const std::string_view text) &&;
[[gnu::noinline]] EvalErrorBuilder<T> withSuggestions(Suggestions & s) &&;
-14
View File
@@ -35,20 +35,6 @@ void Value::print(EvalState & state, std::ostream & str, PrintOptions options)
printValue(state, str, *this, options);
}
PosIdx Value::determinePos(const PosIdx pos) const
{
// Allow selecting a subset of enum values
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wswitch-enum"
switch (internalType) {
case tAttrs: return attrs->pos;
case tLambda: return lambda.fun->pos;
case tApp: return app.left->determinePos(pos);
default: return pos;
}
#pragma GCC diagnostic pop
}
bool Value::isTrivial() const
{
return
-2
View File
@@ -790,8 +790,6 @@ public:
return internalType == tList1 ? 1 : internalType == tList2 ? 2 : bigList.size;
}
PosIdx determinePos(const PosIdx pos) const;
/**
* Check whether forcing this value requires a trivial amount of
* computation. In particular, function applications are