This commit is contained in:
Félix Baylac-Jacqué 2019-10-20 10:00:16 +02:00
parent dd37b181c0
commit d2e7024eda
2 changed files with 25 additions and 5 deletions

View File

@ -959,7 +959,10 @@ void ExprList::eval(EvalState & state, Env & env, Value & v)
void ExprVar::eval(EvalState & state, Env & env, Value & v)
{
Value * v2 = state.lookupVar(&env, *this, false);
state.profState.nestedLevel++;
state.profState.printNestedStuff(*this);
state.forceValue(*v2, pos);
state.profState.nestedLevel--;
v = *v2;
}
@ -1002,10 +1005,7 @@ void ExprSelect::eval(EvalState & state, Env & env, Value & v)
if (vAttrs->type != tAttrs ||
(j = vAttrs->attrs->find(name)) == vAttrs->attrs->end())
{
std::cout << "Going into " << name << std::endl;
state.profState
def->eval(state, env, v);
std::cout << " " << name << std::endl;
return;
}
} else {
@ -2014,8 +2014,9 @@ static GlobalConfig::Register r1(&evalSettings);
*****************
*/
ProfilerState::ProfilerState() {
}
ProfilerState::ProfilerState():
nestedLevel(0)
{}
CompressedFileId ProfilerState::registerFile(FileName& fName) {
CompressedFileId fid;
@ -2045,4 +2046,20 @@ CompressedFuncId ProfilerState::registerFunction(FunctionName& fName) {
return fid;
}
void ProfilerState::printNestedStuff(Symbol& name) {
string delim = "";
for(int i=0;i<nestedLevel;i++) {
delim += "=";
}
std::cout << delim << " Going into " << name << std::endl;
}
void ProfilerState::printNestedStuff(ExprVar& name) {
string delim = "";
for(int i=0;i<nestedLevel;i++) {
delim += "=";
}
std::cout << delim << " Going into " << name << std::endl;
}
}

View File

@ -57,6 +57,8 @@ public:
CompressedFuncId registerFunction(FunctionName& fName);
ProfCostOcc& getFuncOcc(FileName& fName, FunctionName& fnName);
void saveCost(ProfCostOcc& occCost);
void printNestedStuff(Symbol& name);
void printNestedStuff(ExprVar& name);
public:
std::vector<ProfCostOcc> stackedMeasurements;
@ -67,6 +69,7 @@ public:
std::map<FileName,CompressedFileId> fileMap;
CompressedFuncId currentFuncId;
CompressedFileId currentFileId;
int nestedLevel;
};