Skip to content
GitLab
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
51fbf969
Commit
51fbf969
authored
May 26, 2010
by
Erik Verbruggen
Browse files
Added support for the GCC "unavailable" attribute.
parent
9e89f36c
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/shared/cplusplus/CheckSpecifier.cpp
View file @
51fbf969
...
...
@@ -439,8 +439,12 @@ bool CheckSpecifier::visit(TypeofSpecifierAST *ast)
bool
CheckSpecifier
::
visit
(
AttributeAST
*
ast
)
{
if
(
ast
->
identifier_token
)
{
if
(
identifier
(
ast
->
identifier_token
)
==
control
()
->
deprecatedId
())
const
Identifier
*
id
=
identifier
(
ast
->
identifier_token
);
if
(
id
==
control
()
->
deprecatedId
())
_fullySpecifiedType
.
setDeprecated
(
true
);
else
if
(
id
==
control
()
->
unavailableId
())
_fullySpecifiedType
.
setUnavailable
(
true
);
}
return
false
;
}
src/shared/cplusplus/Control.cpp
View file @
51fbf969
...
...
@@ -516,6 +516,7 @@ public:
std
::
vector
<
Symbol
*>
symbols
;
const
Identifier
*
deprecatedId
;
const
Identifier
*
unavailableId
;
// ObjC context keywords:
const
Identifier
*
objcGetterId
;
const
Identifier
*
objcSetterId
;
...
...
@@ -532,6 +533,7 @@ Control::Control()
d
=
new
Data
(
this
);
d
->
deprecatedId
=
findOrInsertIdentifier
(
"deprecated"
);
d
->
unavailableId
=
findOrInsertIdentifier
(
"unavailable"
);
d
->
objcGetterId
=
findOrInsertIdentifier
(
"getter"
);
d
->
objcSetterId
=
findOrInsertIdentifier
(
"setter"
);
...
...
@@ -736,6 +738,9 @@ ObjCPropertyDeclaration *Control::newObjCPropertyDeclaration(unsigned sourceLoca
const
Identifier
*
Control
::
deprecatedId
()
const
{
return
d
->
deprecatedId
;
}
const
Identifier
*
Control
::
unavailableId
()
const
{
return
d
->
unavailableId
;
}
const
Identifier
*
Control
::
objcGetterId
()
const
{
return
d
->
objcGetterId
;
}
...
...
src/shared/cplusplus/Control.h
View file @
51fbf969
...
...
@@ -177,6 +177,7 @@ public:
ObjCPropertyDeclaration
*
newObjCPropertyDeclaration
(
unsigned
sourceLocation
,
const
Name
*
name
);
const
Identifier
*
deprecatedId
()
const
;
const
Identifier
*
unavailableId
()
const
;
// Objective-C specific context keywords.
const
Identifier
*
objcGetterId
()
const
;
const
Identifier
*
objcSetterId
()
const
;
...
...
src/shared/cplusplus/FullySpecifiedType.cpp
View file @
51fbf969
...
...
@@ -87,6 +87,7 @@ FullySpecifiedType FullySpecifiedType::qualifiedType() const
ty
.
setExplicit
(
false
);
ty
.
setDeprecated
(
false
);
ty
.
setUnavailable
(
false
);
return
ty
;
}
...
...
@@ -180,6 +181,12 @@ bool FullySpecifiedType::isDeprecated() const
void
FullySpecifiedType
::
setDeprecated
(
bool
isDeprecated
)
{
f
.
_isDeprecated
=
isDeprecated
;
}
bool
FullySpecifiedType
::
isUnavailable
()
const
{
return
f
.
_isUnavailable
;
}
void
FullySpecifiedType
::
setUnavailable
(
bool
isUnavailable
)
{
f
.
_isUnavailable
=
isUnavailable
;
}
bool
FullySpecifiedType
::
isEqualTo
(
const
FullySpecifiedType
&
other
)
const
{
if
(
_flags
!=
other
.
_flags
)
...
...
src/shared/cplusplus/FullySpecifiedType.h
View file @
51fbf969
...
...
@@ -113,6 +113,9 @@ public:
bool
isDeprecated
()
const
;
void
setDeprecated
(
bool
isDeprecated
);
bool
isUnavailable
()
const
;
void
setUnavailable
(
bool
isUnavailable
);
bool
isEqualTo
(
const
FullySpecifiedType
&
other
)
const
;
Type
&
operator
*
();
...
...
@@ -158,6 +161,7 @@ private:
// speficiers from attributes
unsigned
_isDeprecated
:
1
;
unsigned
_isUnavailable
:
1
;
};
union
{
unsigned
_flags
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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