Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tobias Hunger
qt-creator
Commits
43df685c
Commit
43df685c
authored
Dec 03, 2009
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed useless arguments
parent
04a6d467
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
31 deletions
+13
-31
src/libs/cplusplus/FindUsages.cpp
src/libs/cplusplus/FindUsages.cpp
+9
-4
src/libs/cplusplus/FindUsages.h
src/libs/cplusplus/FindUsages.h
+1
-1
src/plugins/cpptools/cppfindreferences.cpp
src/plugins/cpptools/cppfindreferences.cpp
+3
-26
No files found.
src/libs/cplusplus/FindUsages.cpp
View file @
43df685c
...
...
@@ -35,6 +35,7 @@
#include <Names.h>
#include <Symbols.h>
#include <AST.h>
#include <TranslationUnit.h>
#include <QtCore/QDir>
...
...
@@ -63,16 +64,20 @@ QList<Usage> FindUsages::usages() const
QList
<
int
>
FindUsages
::
references
()
const
{
return
_references
;
}
void
FindUsages
::
operator
()(
Symbol
*
symbol
,
const
Identifier
*
id
,
AST
*
ast
)
void
FindUsages
::
operator
()(
Symbol
*
symbol
)
{
_processed
.
clear
();
_references
.
clear
();
_usages
.
clear
();
_declSymbol
=
symbol
;
_id
=
id
;
if
(
_declSymbol
&&
_id
)
{
_id
=
0
;
if
(
_declSymbol
&&
0
!=
&
(
_id
=
_declSymbol
->
identifier
()))
_id
=
_doc
->
control
()
->
findOrInsertIdentifier
(
_id
->
chars
(),
_id
->
size
());
if
(
_id
)
{
_exprDoc
=
Document
::
create
(
"<references>"
);
accept
(
ast
);
accept
(
_doc
->
translationUnit
()
->
ast
()
);
}
}
...
...
src/libs/cplusplus/FindUsages.h
View file @
43df685c
...
...
@@ -64,7 +64,7 @@ public:
void
setGlobalNamespaceBinding
(
NamespaceBindingPtr
globalNamespaceBinding
);
void
operator
()(
Symbol
*
symbol
,
const
Identifier
*
id
,
AST
*
ast
);
void
operator
()(
Symbol
*
symbol
);
QList
<
Usage
>
usages
()
const
;
QList
<
int
>
references
()
const
;
...
...
src/plugins/cpptools/cppfindreferences.cpp
View file @
43df685c
...
...
@@ -79,21 +79,11 @@ QList<int> CppFindReferences::references(Symbol *symbol,
Document
::
Ptr
doc
,
const
Snapshot
&
snapshot
)
const
{
const
Identifier
*
id
=
0
;
if
(
const
Identifier
*
symbolId
=
symbol
->
identifier
())
id
=
doc
->
control
()
->
findIdentifier
(
symbolId
->
chars
(),
symbolId
->
size
());
QList
<
int
>
references
;
if
(
!
id
)
return
references
;
TranslationUnit
*
translationUnit
=
doc
->
translationUnit
();
Q_ASSERT
(
translationUnit
!=
0
);
FindUsages
findUsages
(
doc
,
snapshot
,
/*future = */
0
);
findUsages
.
setGlobalNamespaceBinding
(
bind
(
doc
,
snapshot
));
findUsages
(
symbol
,
id
,
translationUnit
->
ast
()
);
findUsages
(
symbol
);
references
=
findUsages
.
references
();
return
references
;
...
...
@@ -165,26 +155,13 @@ static void find_helper(QFutureInterface<Usage> &future,
doc
->
tokenize
();
Control
*
control
=
doc
->
control
();
if
(
const
Identifier
*
id
=
control
->
findIdentifier
(
symbolId
->
chars
(),
symbolId
->
size
()))
{
QTime
tm
;
tm
.
start
();
doc
->
parse
();
//qDebug() << "***" << unit->fileName() << "parsed in:" << tm.elapsed();
tm
.
start
();
if
(
control
->
findIdentifier
(
symbolId
->
chars
(),
symbolId
->
size
())
!=
0
)
{
doc
->
check
();
//qDebug() << "***" << unit->fileName() << "checked in:" << tm.elapsed();
tm
.
start
();
FindUsages
process
(
doc
,
snapshot
,
&
future
);
process
.
setGlobalNamespaceBinding
(
bind
(
doc
,
snapshot
));
TranslationUnit
*
unit
=
doc
->
translationUnit
();
process
(
symbol
,
id
,
unit
->
ast
());
//qDebug() << "***" << unit->fileName() << "processed in:" << tm.elapsed();
process
(
symbol
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment