Extract a Value method to set the eval cache

This commit is contained in:
regnat
2021-06-03 10:52:43 +02:00
parent 45a28ed36f
commit 89951cf7fb
2 changed files with 8 additions and 0 deletions

View File

@@ -1813,6 +1813,13 @@ ValueCache & Value::getEvalCache()
ValueCache ValueCache::empty = ValueCache(nullptr);
void Value::setEvalCache(ValueCache & newCache)
{
if (internalType == tAttrs) {
attrs->eval_cache = newCache;
}
}
string EvalState::forceString(Value & v, PathSet & context, const Pos & pos)
{
string s = forceString(v, pos);

View File

@@ -353,6 +353,7 @@ public:
std::vector<std::pair<Path, std::string>> getContext();
ValueCache & getEvalCache();
void setEvalCache(ValueCache &);
};