Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
9341f7da
Commit
9341f7da
authored
15 years ago
by
Oswald Buddenhagen
Browse files
Options
Downloads
Patches
Plain Diff
de-virtualize ProItem::kind(); use variable instead
now items have no vtable any more
parent
14353128
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/shared/proparser/proitems.cpp
+1
-26
1 addition, 26 deletions
src/shared/proparser/proitems.cpp
src/shared/proparser/proitems.h
+7
-17
7 additions, 17 deletions
src/shared/proparser/proitems.h
with
8 additions
and
43 deletions
src/shared/proparser/proitems.cpp
+
1
−
26
View file @
9341f7da
...
...
@@ -34,6 +34,7 @@
QT_BEGIN_NAMESPACE
ProBlock
::
ProBlock
()
:
ProItem
(
BlockKind
)
{
m_blockKind
=
0
;
m_refCount
=
1
;
...
...
@@ -48,32 +49,6 @@ ProBlock::~ProBlock()
delete
itm
;
}
ProItem
::
ProItemKind
ProBlock
::
kind
()
const
{
return
ProItem
::
BlockKind
;
}
ProItem
::
ProItemKind
ProVariable
::
kind
()
const
{
return
ProItem
::
VariableKind
;
}
ProItem
::
ProItemKind
ProFunction
::
kind
()
const
{
return
ProItem
::
FunctionKind
;
}
ProItem
::
ProItemKind
ProCondition
::
kind
()
const
{
return
ProItem
::
ConditionKind
;
}
ProItem
::
ProItemKind
ProOperator
::
kind
()
const
{
return
ProItem
::
OperatorKind
;
}
// --------------- ProFile ----------------
ProFile
::
ProFile
(
const
QString
&
fileName
)
:
ProBlock
()
{
...
...
This diff is collapsed.
Click to expand it.
src/shared/proparser/proitems.h
+
7
−
17
View file @
9341f7da
...
...
@@ -56,15 +56,15 @@ public:
ReturnReturn
};
ProItem
()
:
m_lineNumber
(
0
)
{}
virtual
~
ProItem
()
{}
ProItem
(
ProItemKind
kind
)
:
m_kind
(
kind
),
m_lineNumber
(
0
)
{}
virtual
ProItemKind
kind
()
const
=
0
;
ProItemKind
kind
()
const
{
return
m_kind
;
}
int
lineNumber
()
const
{
return
m_lineNumber
;
}
void
setLineNumber
(
int
lineNumber
)
{
m_lineNumber
=
lineNumber
;
}
private
:
ProItemKind
m_kind
;
int
m_lineNumber
;
};
...
...
@@ -91,8 +91,6 @@ public:
void
ref
()
{
++
m_refCount
;
}
void
deref
()
{
if
(
!--
m_refCount
)
delete
this
;
}
ProItem
::
ProItemKind
kind
()
const
;
private
:
QList
<
ProItem
*>
m_proitems
;
int
m_blockKind
;
...
...
@@ -110,7 +108,7 @@ public:
UniqueAddOperator
=
4
};
ProVariable
(
const
QString
&
name
)
:
m_variableKind
(
SetOperator
),
m_variable
(
name
)
{}
ProVariable
(
const
QString
&
name
)
:
ProItem
(
VariableKind
),
m_variableKind
(
SetOperator
),
m_variable
(
name
)
{}
void
setVariableOperator
(
VariableOperator
variableKind
)
{
m_variableKind
=
variableKind
;
}
VariableOperator
variableOperator
()
const
{
return
m_variableKind
;
}
void
setVariable
(
const
QString
&
name
)
{
m_variable
=
name
;
}
...
...
@@ -118,8 +116,6 @@ public:
void
setValue
(
const
QString
&
value
)
{
m_value
=
value
;
}
QString
value
()
const
{
return
m_value
;
}
ProItem
::
ProItemKind
kind
()
const
;
private
:
VariableOperator
m_variableKind
;
QString
m_variable
;
...
...
@@ -129,12 +125,10 @@ private:
class
ProFunction
:
public
ProItem
{
public:
explicit
ProFunction
(
const
QString
&
text
)
:
m_text
(
text
)
{}
explicit
ProFunction
(
const
QString
&
text
)
:
ProItem
(
FunctionKind
),
m_text
(
text
)
{}
void
setText
(
const
QString
&
text
)
{
m_text
=
text
;
}
QString
text
()
const
{
return
m_text
;
}
ProItem
::
ProItemKind
kind
()
const
;
private
:
QString
m_text
;
};
...
...
@@ -142,12 +136,10 @@ private:
class
ProCondition
:
public
ProItem
{
public:
explicit
ProCondition
(
const
QString
&
text
)
:
m_text
(
text
)
{}
explicit
ProCondition
(
const
QString
&
text
)
:
ProItem
(
ConditionKind
),
m_text
(
text
)
{}
void
setText
(
const
QString
&
text
)
{
m_text
=
text
;
}
QString
text
()
const
{
return
m_text
;
}
ProItem
::
ProItemKind
kind
()
const
;
private
:
QString
m_text
;
};
...
...
@@ -160,12 +152,10 @@ public:
NotOperator
=
2
};
explicit
ProOperator
(
OperatorKind
operatorKind
)
:
m_operatorKind
(
operatorKind
)
{}
explicit
ProOperator
(
OperatorKind
operatorKind
)
:
ProItem
(
ProItem
::
OperatorKind
),
m_operatorKind
(
operatorKind
)
{}
void
setOperatorKind
(
OperatorKind
operatorKind
)
{
m_operatorKind
=
operatorKind
;
}
OperatorKind
operatorKind
()
const
{
return
m_operatorKind
;
}
ProItem
::
ProItemKind
kind
()
const
;
private
:
OperatorKind
m_operatorKind
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment