mirror of
https://github.com/NixOS/nix.git
synced 2025-11-25 11:49:35 +01:00
* Option to turn off position information to test the impact on
maximal sharing.
This commit is contained in:
parent
e23d134b85
commit
a10da8466f
2 changed files with 7 additions and 3 deletions
|
|
@ -21,7 +21,8 @@ int cacheTerms;
|
||||||
|
|
||||||
bool shortCircuit;
|
bool shortCircuit;
|
||||||
bool closedTerms; // don't substitute under terms known to be closed
|
bool closedTerms; // don't substitute under terms known to be closed
|
||||||
bool substCache; // memoization of the term substitution function
|
bool substCache; // memoization of the term substitution function
|
||||||
|
bool posInfo; // attach position info to functions, assertions, attributes
|
||||||
|
|
||||||
#define maxActiveCalls 4096
|
#define maxActiveCalls 4096
|
||||||
|
|
||||||
|
|
@ -43,6 +44,7 @@ EvalState::EvalState()
|
||||||
strictMode = getEnv("NIX_STRICT", "0") == "1";
|
strictMode = getEnv("NIX_STRICT", "0") == "1";
|
||||||
closedTerms = getEnv("NIX_CLOSED_TERMS", "1") == "1";
|
closedTerms = getEnv("NIX_CLOSED_TERMS", "1") == "1";
|
||||||
substCache = getEnv("NIX_SUBST_CACHE", "1") == "1";
|
substCache = getEnv("NIX_SUBST_CACHE", "1") == "1";
|
||||||
|
posInfo = getEnv("NIX_POS_INFO", "1") == "1";
|
||||||
|
|
||||||
ATprotectMemory(activeCalls, maxActiveCalls);
|
ATprotectMemory(activeCalls, maxActiveCalls);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,11 +70,13 @@ static Expr fixAttrs(int recursive, ATermList as)
|
||||||
|
|
||||||
void backToString(yyscan_t scanner);
|
void backToString(yyscan_t scanner);
|
||||||
|
|
||||||
|
|
||||||
|
extern bool posInfo;
|
||||||
|
|
||||||
static Pos makeCurPos(YYLTYPE * loc, ParseData * data)
|
static Pos makeCurPos(YYLTYPE * loc, ParseData * data)
|
||||||
{
|
{
|
||||||
return makePos(toATerm(data->path),
|
return posInfo ? makePos(toATerm(data->path),
|
||||||
loc->first_line, loc->first_column);
|
loc->first_line, loc->first_column) : makeNoPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CUR_POS makeCurPos(yylocp, data)
|
#define CUR_POS makeCurPos(yylocp, data)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue