QString Debugger::name(VM::FunctionObject *function) const
{
if (FunctionDebugInfo *i = debugInfo(function))
- if (i->function)
- if (const QString *n = i->function->name)
- return *n;
+ return i->name;
return QString();
}
class Debugger;
struct FunctionDebugInfo { // TODO: use opaque d-pointers here
- IR::Function *function;
+ QString name;
unsigned startLine, startColumn;
- FunctionDebugInfo(IR::Function *function): function(function), startLine(0), startColumn(0) {}
+
+ FunctionDebugInfo(IR::Function *function):
+ startLine(0), startColumn(0)
+ {
+ if (function->name)
+ name = *function->name;
+ }
void setSourceLocation(unsigned line, unsigned column)
{ startLine = line; startColumn = column; }
public:
void run(IR::Function *function)
{
+#ifdef DEBUG_TEMP_COMPRESSION
+ qDebug() << "starting on function" << (*function->name) << "with" << function->tempCount << "temps.";
+#endif // DEBUG_TEMP_COMPRESSION
+
_seenTemps.clear();
_nextFree = 0;
_active.reserve(function->tempCount);