Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
dfadb0d0
Commit
dfadb0d0
authored
May 26, 2010
by
Erik Verbruggen
Browse files
Added support for the GCC "unavailable" attribute.
parent
49c75444
Changes
4
Show whitespace changes
Inline
Side-by-side
src/shared/cplusplus/CheckDeclaration.cpp
View file @
dfadb0d0
...
@@ -177,6 +177,8 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast)
...
@@ -177,6 +177,8 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast)
if
(
ty
.
isDeprecated
())
if
(
ty
.
isDeprecated
())
symbol
->
setDeprecated
(
true
);
symbol
->
setDeprecated
(
true
);
if
(
ty
.
isUnavailable
())
symbol
->
setUnavailable
(
true
);
if
(
ty
.
isFriend
())
if
(
ty
.
isFriend
())
symbol
->
setStorage
(
Symbol
::
Friend
);
symbol
->
setStorage
(
Symbol
::
Friend
);
...
@@ -213,6 +215,8 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast)
...
@@ -213,6 +215,8 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast)
fun
->
setVirtual
(
ty
.
isVirtual
());
fun
->
setVirtual
(
ty
.
isVirtual
());
if
(
ty
.
isDeprecated
())
if
(
ty
.
isDeprecated
())
fun
->
setDeprecated
(
true
);
fun
->
setDeprecated
(
true
);
if
(
ty
.
isUnavailable
())
fun
->
setUnavailable
(
true
);
if
(
isQ_SIGNAL
)
if
(
isQ_SIGNAL
)
fun
->
setMethodKey
(
Function
::
SignalMethod
);
fun
->
setMethodKey
(
Function
::
SignalMethod
);
else
if
(
isQ_SLOT
)
else
if
(
isQ_SLOT
)
...
@@ -232,6 +236,8 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast)
...
@@ -232,6 +236,8 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast)
symbol
->
setType
(
declTy
);
symbol
->
setType
(
declTy
);
if
(
declTy
.
isDeprecated
())
if
(
declTy
.
isDeprecated
())
symbol
->
setDeprecated
(
true
);
symbol
->
setDeprecated
(
true
);
if
(
declTy
.
isUnavailable
())
symbol
->
setUnavailable
(
true
);
if
(
_templateParameters
&&
it
==
ast
->
declarator_list
)
{
if
(
_templateParameters
&&
it
==
ast
->
declarator_list
)
{
symbol
->
setTemplateParameters
(
_templateParameters
);
symbol
->
setTemplateParameters
(
_templateParameters
);
...
@@ -257,6 +263,8 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast)
...
@@ -257,6 +263,8 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast)
if
(
ty
.
isDeprecated
())
if
(
ty
.
isDeprecated
())
symbol
->
setDeprecated
(
true
);
symbol
->
setDeprecated
(
true
);
if
(
ty
.
isUnavailable
())
symbol
->
setUnavailable
(
true
);
if
(
it
->
value
&&
it
->
value
->
initializer
)
{
if
(
it
->
value
&&
it
->
value
->
initializer
)
{
FullySpecifiedType
initTy
=
semantic
()
->
check
(
it
->
value
->
initializer
,
_scope
);
FullySpecifiedType
initTy
=
semantic
()
->
check
(
it
->
value
->
initializer
,
_scope
);
...
@@ -338,6 +346,8 @@ bool CheckDeclaration::visit(FunctionDefinitionAST *ast)
...
@@ -338,6 +346,8 @@ bool CheckDeclaration::visit(FunctionDefinitionAST *ast)
fun
->
setVirtual
(
ty
.
isVirtual
());
fun
->
setVirtual
(
ty
.
isVirtual
());
if
(
ty
.
isDeprecated
())
if
(
ty
.
isDeprecated
())
fun
->
setDeprecated
(
true
);
fun
->
setDeprecated
(
true
);
if
(
ty
.
isUnavailable
())
fun
->
setUnavailable
(
true
);
fun
->
setStartOffset
(
tokenAt
(
ast
->
firstToken
()).
offset
);
fun
->
setStartOffset
(
tokenAt
(
ast
->
firstToken
()).
offset
);
fun
->
setEndOffset
(
tokenAt
(
ast
->
lastToken
()).
offset
);
fun
->
setEndOffset
(
tokenAt
(
ast
->
lastToken
()).
offset
);
if
(
ast
->
declarator
)
if
(
ast
->
declarator
)
...
@@ -727,6 +737,8 @@ bool CheckDeclaration::visit(ObjCMethodDeclarationAST *ast)
...
@@ -727,6 +737,8 @@ bool CheckDeclaration::visit(ObjCMethodDeclarationAST *ast)
symbol
->
setVisibility
(
semantic
()
->
currentObjCVisibility
());
symbol
->
setVisibility
(
semantic
()
->
currentObjCVisibility
());
if
(
ty
.
isDeprecated
())
if
(
ty
.
isDeprecated
())
symbol
->
setDeprecated
(
true
);
symbol
->
setDeprecated
(
true
);
if
(
ty
.
isUnavailable
())
symbol
->
setUnavailable
(
true
);
_scope
->
enterSymbol
(
symbol
);
_scope
->
enterSymbol
(
symbol
);
...
...
src/shared/cplusplus/CheckSpecifier.cpp
View file @
dfadb0d0
...
@@ -346,6 +346,8 @@ bool CheckSpecifier::visit(ClassSpecifierAST *ast)
...
@@ -346,6 +346,8 @@ bool CheckSpecifier::visit(ClassSpecifierAST *ast)
if
(
_fullySpecifiedType
.
isDeprecated
())
if
(
_fullySpecifiedType
.
isDeprecated
())
klass
->
setDeprecated
(
true
);
klass
->
setDeprecated
(
true
);
if
(
_fullySpecifiedType
.
isUnavailable
())
klass
->
setUnavailable
(
true
);
for
(
BaseSpecifierListAST
*
it
=
ast
->
base_clause_list
;
it
;
it
=
it
->
next
)
{
for
(
BaseSpecifierListAST
*
it
=
ast
->
base_clause_list
;
it
;
it
=
it
->
next
)
{
BaseSpecifierAST
*
base
=
it
->
value
;
BaseSpecifierAST
*
base
=
it
->
value
;
...
...
src/shared/cplusplus/Symbol.cpp
View file @
dfadb0d0
...
@@ -170,7 +170,9 @@ Symbol::Symbol(TranslationUnit *translationUnit, unsigned sourceLocation, const
...
@@ -170,7 +170,9 @@ Symbol::Symbol(TranslationUnit *translationUnit, unsigned sourceLocation, const
_scope
(
0
),
_scope
(
0
),
_index
(
0
),
_index
(
0
),
_next
(
0
),
_next
(
0
),
_isGenerated
(
false
)
_isGenerated
(
false
),
_isDeprecated
(
false
),
_isUnavailable
(
false
)
{
{
setSourceLocation
(
sourceLocation
,
translationUnit
);
setSourceLocation
(
sourceLocation
,
translationUnit
);
setName
(
name
);
setName
(
name
);
...
@@ -206,6 +208,12 @@ bool Symbol::isDeprecated() const
...
@@ -206,6 +208,12 @@ bool Symbol::isDeprecated() const
void
Symbol
::
setDeprecated
(
bool
isDeprecated
)
void
Symbol
::
setDeprecated
(
bool
isDeprecated
)
{
_isDeprecated
=
isDeprecated
;
}
{
_isDeprecated
=
isDeprecated
;
}
bool
Symbol
::
isUnavailable
()
const
{
return
_isUnavailable
;
}
void
Symbol
::
setUnavailable
(
bool
isUnavailable
)
{
_isUnavailable
=
isUnavailable
;
}
void
Symbol
::
setSourceLocation
(
unsigned
sourceLocation
,
TranslationUnit
*
translationUnit
)
void
Symbol
::
setSourceLocation
(
unsigned
sourceLocation
,
TranslationUnit
*
translationUnit
)
{
{
_sourceLocation
=
sourceLocation
;
_sourceLocation
=
sourceLocation
;
...
...
src/shared/cplusplus/Symbol.h
View file @
dfadb0d0
...
@@ -287,6 +287,9 @@ public:
...
@@ -287,6 +287,9 @@ public:
bool
isDeprecated
()
const
;
bool
isDeprecated
()
const
;
void
setDeprecated
(
bool
isDeprecated
);
void
setDeprecated
(
bool
isDeprecated
);
bool
isUnavailable
()
const
;
void
setUnavailable
(
bool
isUnavailable
);
Symbol
*
enclosingSymbol
()
const
;
Symbol
*
enclosingSymbol
()
const
;
/// Returns the eclosing namespace scope.
/// Returns the eclosing namespace scope.
...
@@ -332,6 +335,7 @@ private:
...
@@ -332,6 +335,7 @@ private:
bool
_isGenerated
:
1
;
bool
_isGenerated
:
1
;
bool
_isDeprecated
:
1
;
bool
_isDeprecated
:
1
;
bool
_isUnavailable
:
1
;
class
IdentityForName
;
class
IdentityForName
;
class
HashCode
;
class
HashCode
;
...
...
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