forked from qt-creator/qt-creator
don't pre-split RHS of variable assignments
creating tons of items is a tad allocation-intensive and thus slow. this is probably slower for often-included files, as now the splitting is done in every evaluation pass.
This commit is contained in:
@@ -45,6 +45,7 @@ public:
|
||||
FunctionKind,
|
||||
ConditionKind,
|
||||
OperatorKind,
|
||||
VariableKind,
|
||||
BlockKind
|
||||
};
|
||||
|
||||
@@ -78,7 +79,6 @@ public:
|
||||
NormalKind = 0x00,
|
||||
ScopeKind = 0x01,
|
||||
ScopeContentsKind = 0x02,
|
||||
VariableKind = 0x04,
|
||||
ProFileKind = 0x08,
|
||||
FunctionBodyKind = 0x10,
|
||||
SingleLine = 0x80
|
||||
@@ -111,7 +111,7 @@ private:
|
||||
int m_refCount;
|
||||
};
|
||||
|
||||
class ProVariable : public ProBlock
|
||||
class ProVariable : public ProItem
|
||||
{
|
||||
public:
|
||||
enum VariableOperator {
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
UniqueAddOperator = 4
|
||||
};
|
||||
|
||||
ProVariable(const QString &name, ProBlock *parent);
|
||||
ProVariable(const QString &name);
|
||||
|
||||
void setVariableOperator(VariableOperator variableKind);
|
||||
VariableOperator variableOperator() const;
|
||||
@@ -130,29 +130,16 @@ public:
|
||||
void setVariable(const QString &name);
|
||||
QString variable() const;
|
||||
|
||||
virtual ProItemReturn Accept(AbstractProItemVisitor *visitor);
|
||||
private:
|
||||
VariableOperator m_variableKind;
|
||||
QString m_variable;
|
||||
};
|
||||
|
||||
class ProValue : public ProItem
|
||||
{
|
||||
public:
|
||||
ProValue(const QString &value, ProVariable *variable);
|
||||
|
||||
void setValue(const QString &value);
|
||||
QString value() const;
|
||||
|
||||
void setVariable(ProVariable *variable);
|
||||
ProVariable *variable() const;
|
||||
|
||||
ProItem::ProItemKind kind() const;
|
||||
|
||||
virtual ProItemReturn Accept(AbstractProItemVisitor *visitor);
|
||||
private:
|
||||
VariableOperator m_variableKind;
|
||||
QString m_variable;
|
||||
QString m_value;
|
||||
ProVariable *m_variable;
|
||||
};
|
||||
|
||||
class ProFunction : public ProItem
|
||||
|
||||
Reference in New Issue
Block a user