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
6c347a12
Commit
6c347a12
authored
Sep 07, 2009
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduced LiteralTable::findLiteral() and Control::findIdentifier()
parent
8848be4c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
src/shared/cplusplus/Control.cpp
src/shared/cplusplus/Control.cpp
+3
-0
src/shared/cplusplus/Control.h
src/shared/cplusplus/Control.h
+2
-0
src/shared/cplusplus/LiteralTable.h
src/shared/cplusplus/LiteralTable.h
+15
-1
No files found.
src/shared/cplusplus/Control.cpp
View file @
6c347a12
...
...
@@ -582,6 +582,9 @@ DiagnosticClient *Control::diagnosticClient() const
void
Control
::
setDiagnosticClient
(
DiagnosticClient
*
diagnosticClient
)
{
d
->
diagnosticClient
=
diagnosticClient
;
}
Identifier
*
Control
::
findIdentifier
(
const
char
*
chars
,
unsigned
size
)
const
{
return
d
->
identifiers
.
findLiteral
(
chars
,
size
);
}
Identifier
*
Control
::
findOrInsertIdentifier
(
const
char
*
chars
,
unsigned
size
)
{
return
d
->
identifiers
.
findOrInsertLiteral
(
chars
,
size
);
}
...
...
src/shared/cplusplus/Control.h
View file @
6c347a12
...
...
@@ -166,6 +166,8 @@ public:
/// Creates a new Objective-C method symbol.
ObjCMethod
*
newObjCMethod
(
unsigned
sourceLocation
,
Name
*
name
=
0
);
Identifier
*
findIdentifier
(
const
char
*
chars
,
unsigned
size
)
const
;
Identifier
*
findOrInsertIdentifier
(
const
char
*
chars
,
unsigned
size
);
Identifier
*
findOrInsertIdentifier
(
const
char
*
chars
);
...
...
src/shared/cplusplus/LiteralTable.h
View file @
6c347a12
...
...
@@ -101,7 +101,21 @@ public:
iterator
end
()
const
{
return
_literals
+
_literalCount
+
1
;
}
_Literal
*
findOrInsertLiteral
(
const
char
*
chars
,
unsigned
size
)
_Literal
*
findLiteral
(
const
char
*
chars
,
unsigned
size
)
const
{
if
(
_buckets
)
{
unsigned
h
=
_Literal
::
hashCode
(
chars
,
size
);
_Literal
*
literal
=
_buckets
[
h
%
_allocatedBuckets
];
for
(;
literal
;
literal
=
static_cast
<
_Literal
*>
(
literal
->
_next
))
{
if
(
literal
->
size
()
==
size
&&
!
std
::
strncmp
(
literal
->
chars
(),
chars
,
size
))
return
literal
;
}
}
return
0
;
}
_Literal
*
findOrInsertLiteral
(
const
char
*
chars
,
unsigned
size
)
{
if
(
_buckets
)
{
unsigned
h
=
_Literal
::
hashCode
(
chars
,
size
);
...
...
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