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
a592df02
Commit
a592df02
authored
Aug 13, 2010
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply the decl specifiers.
parent
b44e1957
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
src/shared/cplusplus/Bind.cpp
src/shared/cplusplus/Bind.cpp
+41
-0
No files found.
src/shared/cplusplus/Bind.cpp
View file @
a592df02
...
...
@@ -84,6 +84,42 @@ void Bind::setSkipFunctionBodies(bool skipFunctionBodies)
_skipFunctionBodies
=
skipFunctionBodies
;
}
void
Bind
::
setDeclSpecifiers
(
Symbol
*
symbol
,
const
FullySpecifiedType
&
declSpecifiers
)
{
if
(
!
symbol
)
return
;
int
storage
=
Symbol
::
NoStorage
;
if
(
declSpecifiers
.
isFriend
())
storage
=
Symbol
::
Friend
;
else
if
(
declSpecifiers
.
isAuto
())
storage
=
Symbol
::
Auto
;
else
if
(
declSpecifiers
.
isRegister
())
storage
=
Symbol
::
Register
;
else
if
(
declSpecifiers
.
isStatic
())
storage
=
Symbol
::
Static
;
else
if
(
declSpecifiers
.
isExtern
())
storage
=
Symbol
::
Extern
;
else
if
(
declSpecifiers
.
isMutable
())
storage
=
Symbol
::
Mutable
;
else
if
(
declSpecifiers
.
isTypedef
())
storage
=
Symbol
::
Typedef
;
symbol
->
setStorage
(
storage
);
if
(
Function
*
funTy
=
symbol
->
asFunction
())
{
if
(
declSpecifiers
.
isVirtual
())
funTy
->
setVirtual
(
true
);
}
if
(
declSpecifiers
.
isDeprecated
())
symbol
->
setDeprecated
(
true
);
if
(
declSpecifiers
.
isUnavailable
())
symbol
->
setUnavailable
(
true
);
}
Scope
*
Bind
::
switchScope
(
Scope
*
scope
)
{
if
(
!
scope
)
...
...
@@ -1546,6 +1582,7 @@ bool Bind::visit(SimpleDeclarationAST *ast)
Declaration
*
decl
=
control
()
->
newDeclaration
(
sourceLocation
,
declName
);
decl
->
setType
(
declTy
);
setDeclSpecifiers
(
decl
,
type
);
if
(
Function
*
fun
=
decl
->
type
()
->
asFunctionType
())
{
if
(
declaratorId
&&
declaratorId
->
name
)
...
...
@@ -1559,6 +1596,7 @@ bool Bind::visit(SimpleDeclarationAST *ast)
funTy
->
setMethodKey
(
_methodKey
);
}
}
_scope
->
addMember
(
decl
);
*
symbolTail
=
new
(
translationUnit
()
->
memoryPool
())
List
<
Declaration
*>
(
decl
);
...
...
@@ -1692,10 +1730,13 @@ bool Bind::visit(FunctionDefinitionAST *ast)
}
DeclaratorIdAST
*
declaratorId
=
0
;
type
=
this
->
declarator
(
ast
->
declarator
,
type
,
&
declaratorId
);
Function
*
fun
=
type
->
asFunctionType
();
ast
->
symbol
=
fun
;
if
(
fun
)
{
setDeclSpecifiers
(
fun
,
type
);
if
(
_scope
->
isClass
())
{
fun
->
setVisibility
(
_visibility
);
fun
->
setMethodKey
(
_methodKey
);
...
...
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