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
F
flatpak-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
Marco Bubke
flatpak-qt-creator
Commits
abadf320
Commit
abadf320
authored
Aug 13, 2010
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle symbol visibility.
parent
849a52ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
8 deletions
+36
-8
src/shared/cplusplus/Bind.cpp
src/shared/cplusplus/Bind.cpp
+32
-7
src/shared/cplusplus/Bind.h
src/shared/cplusplus/Bind.h
+4
-1
No files found.
src/shared/cplusplus/Bind.cpp
View file @
abadf320
...
...
@@ -66,20 +66,28 @@ Bind::Bind(TranslationUnit *unit)
_scope
(
0
),
_expression
(
0
),
_name
(
0
),
_declaratorId
(
0
)
_declaratorId
(
0
),
_visibility
(
Symbol
::
Public
),
_methodKey
(
Function
::
NormalMethod
)
{
}
Scope
*
Bind
::
currentScope
()
const
Scope
*
Bind
::
switchScope
(
Scope
*
scope
)
{
return
_scope
;
std
::
swap
(
_scope
,
scope
);
return
scope
;
}
Scope
*
Bind
::
switchScope
(
Scope
*
scope
)
int
Bind
::
switchVisibility
(
int
visibility
)
{
std
::
swap
(
_visibility
,
visibility
);
return
visibility
;
}
int
Bind
::
switchMethodKey
(
int
methodKey
)
{
Scope
*
previousScope
=
_scope
;
_scope
=
scope
;
return
previousScope
;
std
::
swap
(
_methodKey
,
methodKey
);
return
methodKey
;
}
void
Bind
::
operator
()(
TranslationUnitAST
*
ast
,
Namespace
*
globalNamespace
)
...
...
@@ -1502,6 +1510,17 @@ bool Bind::visit(AccessDeclarationAST *ast)
// unsigned access_specifier_token = ast->access_specifier_token;
// unsigned slots_token = ast->slots_token;
// unsigned colon_token = ast->colon_token;
const
int
accessSpecifier
=
tokenKind
(
ast
->
access_specifier_token
);
_visibility
=
visibilityForAccessSpecifier
(
accessSpecifier
);
if
(
ast
->
slots_token
)
_methodKey
=
Function
::
SlotMethod
;
else
if
(
accessSpecifier
==
T_Q_SIGNALS
)
_methodKey
=
Function
::
SignalMethod
;
else
_methodKey
=
Function
::
NormalMethod
;
return
false
;
}
...
...
@@ -2170,6 +2189,8 @@ bool Bind::visit(ClassSpecifierAST *ast)
_type
.
setType
(
klass
);
Scope
*
previousScope
=
switchScope
(
klass
);
const
int
previousVisibility
=
switchVisibility
(
Symbol
::
Public
);
const
int
previousMethodKey
=
switchMethodKey
(
Function
::
NormalMethod
);
for
(
BaseSpecifierListAST
*
it
=
ast
->
base_clause_list
;
it
;
it
=
it
->
next
)
{
this
->
baseSpecifier
(
it
->
value
,
ast
->
colon_token
,
klass
);
...
...
@@ -2178,7 +2199,11 @@ bool Bind::visit(ClassSpecifierAST *ast)
for
(
DeclarationListAST
*
it
=
ast
->
member_specifier_list
;
it
;
it
=
it
->
next
)
{
this
->
declaration
(
it
->
value
);
}
(
void
)
switchMethodKey
(
previousMethodKey
);
(
void
)
switchVisibility
(
previousVisibility
);
(
void
)
switchScope
(
previousScope
);
ast
->
symbol
=
klass
;
return
false
;
}
...
...
src/shared/cplusplus/Bind.h
View file @
abadf320
...
...
@@ -79,8 +79,9 @@ protected:
FullySpecifiedType
coreDeclarator
(
CoreDeclaratorAST
*
ast
,
const
FullySpecifiedType
&
init
);
FullySpecifiedType
postfixDeclarator
(
PostfixDeclaratorAST
*
ast
,
const
FullySpecifiedType
&
init
);
Scope
*
currentScope
()
const
;
Scope
*
switchScope
(
Scope
*
scope
);
int
switchVisibility
(
int
visibility
);
int
switchMethodKey
(
int
methodKey
);
const
Name
*
objCSelectorArgument
(
ObjCSelectorArgumentAST
*
ast
,
bool
*
hasArg
);
void
attribute
(
AttributeAST
*
ast
);
...
...
@@ -278,6 +279,8 @@ private:
const
Name
*
_name
;
FullySpecifiedType
_type
;
DeclaratorIdAST
**
_declaratorId
;
int
_visibility
;
int
_methodKey
;
};
}
// end of namespace CPlusPlus
...
...
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