mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
hacks to make thedebugger work again.
This commit is contained in:
parent
717c7acca9
commit
a449fadde2
8 changed files with 123 additions and 9 deletions
|
|
@ -62,6 +62,7 @@ class FuncVars
|
|||
{
|
||||
S32 reg;
|
||||
TypeReq currentType;
|
||||
StringTableEntry name;
|
||||
bool isConstant;
|
||||
};
|
||||
|
||||
|
|
@ -76,7 +77,9 @@ public:
|
|||
}
|
||||
|
||||
S32 id = counter++;
|
||||
vars[var] = { id, currentType, isConstant };
|
||||
vars[var] = { id, currentType, var, isConstant };
|
||||
variableNameMap[id] = var;
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
|
|
@ -97,6 +100,8 @@ public:
|
|||
|
||||
inline S32 count() { return counter; }
|
||||
|
||||
std::unordered_map<S32, StringTableEntry> variableNameMap;
|
||||
|
||||
private:
|
||||
std::unordered_map<StringTableEntry, Var> vars;
|
||||
S32 counter = 0;
|
||||
|
|
@ -1604,6 +1609,14 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream& codeStream, U32 ip)
|
|||
|
||||
setCurrentStringTable(&getGlobalStringTable());
|
||||
setCurrentFloatTable(&getGlobalFloatTable());
|
||||
|
||||
// map local variables to registers for this function.
|
||||
CompilerLocalVariableToRegisterMappingTable* tbl = &getFunctionVariableMappingTable();
|
||||
for (const auto& pair : gFuncVars->variableNameMap)
|
||||
{
|
||||
tbl->add(fnName, pair.second, pair.first);
|
||||
}
|
||||
|
||||
gFuncVars = NULL;
|
||||
|
||||
return ip;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue