Debugging fixes.

Change-Id: I53b7301c28314210f96acc358744ff7e2a65546d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
Erik Verbruggen 2012-12-18 13:53:32 +01:00 committed by Lars Knoll
parent b9c3d61eeb
commit 50eef1d4a1
3 changed files with 13 additions and 5 deletions

View File

@ -123,9 +123,7 @@ FunctionDebugInfo *Debugger::debugInfo(VM::FunctionObject *function) const
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();
}

View File

@ -47,9 +47,15 @@ namespace Debugging {
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; }

View File

@ -29,6 +29,10 @@ class CompressTemps: public IR::StmtVisitor, IR::ExprVisitor
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);