* Option to turn off position information to test the impact on

maximal sharing.
This commit is contained in:
Eelco Dolstra 2007-10-17 12:36:37 +00:00
parent e23d134b85
commit a10da8466f
2 changed files with 7 additions and 3 deletions

View File

@ -22,6 +22,7 @@ int cacheTerms;
bool shortCircuit;
bool closedTerms; // don't substitute under terms known to be closed
bool substCache; // memoization of the term substitution function
bool posInfo; // attach position info to functions, assertions, attributes
#define maxActiveCalls 4096
@ -43,6 +44,7 @@ EvalState::EvalState()
strictMode = getEnv("NIX_STRICT", "0") == "1";
closedTerms = getEnv("NIX_CLOSED_TERMS", "1") == "1";
substCache = getEnv("NIX_SUBST_CACHE", "1") == "1";
posInfo = getEnv("NIX_POS_INFO", "1") == "1";
ATprotectMemory(activeCalls, maxActiveCalls);
}

View File

@ -71,10 +71,12 @@ static Expr fixAttrs(int recursive, ATermList as)
void backToString(yyscan_t scanner);
extern bool posInfo;
static Pos makeCurPos(YYLTYPE * loc, ParseData * data)
{
return makePos(toATerm(data->path),
loc->first_line, loc->first_column);
return posInfo ? makePos(toATerm(data->path),
loc->first_line, loc->first_column) : makeNoPos();
}
#define CUR_POS makeCurPos(yylocp, data)