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
9c038180
Commit
9c038180
authored
Jun 18, 2009
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved compatibility with the gcc extensions.
parent
c3c98cca
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
5 deletions
+38
-5
src/plugins/cpptools/cppmodelmanager.cpp
src/plugins/cpptools/cppmodelmanager.cpp
+2
-0
src/shared/cplusplus/AST.cpp
src/shared/cplusplus/AST.cpp
+8
-1
src/shared/cplusplus/AST.h
src/shared/cplusplus/AST.h
+2
-1
src/shared/cplusplus/ASTClone.cpp
src/shared/cplusplus/ASTClone.cpp
+2
-1
src/shared/cplusplus/ASTVisit.cpp
src/shared/cplusplus/ASTVisit.cpp
+3
-1
src/shared/cplusplus/Parser.cpp
src/shared/cplusplus/Parser.cpp
+18
-1
tests/manual/cplusplus/conf.c++
tests/manual/cplusplus/conf.c++
+3
-0
No files found.
src/plugins/cpptools/cppmodelmanager.cpp
View file @
9c038180
...
...
@@ -150,6 +150,8 @@ static const char pp_configuration[] =
"#define __imag__
\n
"
"#define __real__
\n
"
"#define __builtin_va_arg(a,b) ((b)0)
\n
"
// ### add macros for win32
"#define __cdecl
\n
"
"#define QT_WA(x) x
\n
"
...
...
src/shared/cplusplus/AST.cpp
View file @
9c038180
...
...
@@ -570,6 +570,8 @@ unsigned DeclarationListAST::lastToken() const
unsigned
DeclaratorAST
::
firstToken
()
const
{
if
(
attributes
)
return
attributes
->
firstToken
();
if
(
ptr_operators
)
return
ptr_operators
->
firstToken
();
else
if
(
core_declarator
)
...
...
@@ -589,7 +591,7 @@ unsigned DeclaratorAST::lastToken() const
if
(
initializer
)
return
initializer
->
lastToken
();
for
(
SpecifierAST
*
it
=
attributes
;
it
;
it
=
it
->
next
)
{
for
(
SpecifierAST
*
it
=
post_
attributes
;
it
;
it
=
it
->
next
)
{
if
(
!
it
->
next
)
return
it
->
lastToken
();
}
...
...
@@ -607,6 +609,11 @@ unsigned DeclaratorAST::lastToken() const
return
it
->
lastToken
();
}
for
(
SpecifierAST
*
it
=
attributes
;
it
;
it
=
it
->
next
)
{
if
(
!
it
->
next
)
return
it
->
lastToken
();
}
// ### assert?
return
0
;
}
...
...
src/shared/cplusplus/AST.h
View file @
9c038180
...
...
@@ -371,10 +371,11 @@ public:
class
CPLUSPLUS_EXPORT
DeclaratorAST
:
public
AST
{
public:
SpecifierAST
*
attributes
;
PtrOperatorAST
*
ptr_operators
;
CoreDeclaratorAST
*
core_declarator
;
PostfixDeclaratorAST
*
postfix_declarators
;
SpecifierAST
*
attributes
;
SpecifierAST
*
post_
attributes
;
unsigned
equals_token
;
ExpressionAST
*
initializer
;
...
...
src/shared/cplusplus/ASTClone.cpp
View file @
9c038180
...
...
@@ -97,10 +97,11 @@ DeclaratorAST *DeclaratorAST::clone(MemoryPool *pool) const
{
DeclaratorAST
*
ast
=
new
(
pool
)
DeclaratorAST
;
// copy DeclaratorAST
if
(
attributes
)
ast
->
attributes
=
attributes
->
clone
(
pool
);
if
(
ptr_operators
)
ast
->
ptr_operators
=
ptr_operators
->
clone
(
pool
);
if
(
core_declarator
)
ast
->
core_declarator
=
core_declarator
->
clone
(
pool
);
if
(
postfix_declarators
)
ast
->
postfix_declarators
=
postfix_declarators
->
clone
(
pool
);
if
(
attributes
)
ast
->
attributes
=
attributes
->
clone
(
pool
);
if
(
post_attributes
)
ast
->
post_attributes
=
post_
attributes
->
clone
(
pool
);
ast
->
equals_token
=
equals_token
;
if
(
initializer
)
ast
->
initializer
=
initializer
->
clone
(
pool
);
return
ast
;
...
...
src/shared/cplusplus/ASTVisit.cpp
View file @
9c038180
...
...
@@ -85,12 +85,14 @@ void DeclaratorAST::accept0(ASTVisitor *visitor)
{
if
(
visitor
->
visit
(
this
))
{
// visit DeclaratorAST
for
(
SpecifierAST
*
it
=
attributes
;
it
;
it
=
it
->
next
)
accept
(
it
,
visitor
);
for
(
PtrOperatorAST
*
it
=
ptr_operators
;
it
;
it
=
it
->
next
)
accept
(
it
,
visitor
);
accept
(
core_declarator
,
visitor
);
for
(
PostfixDeclaratorAST
*
it
=
postfix_declarators
;
it
;
it
=
it
->
next
)
accept
(
it
,
visitor
);
for
(
SpecifierAST
*
it
=
attributes
;
it
;
it
=
it
->
next
)
for
(
SpecifierAST
*
it
=
post_
attributes
;
it
;
it
=
it
->
next
)
accept
(
it
,
visitor
);
accept
(
initializer
,
visitor
);
}
...
...
src/shared/cplusplus/Parser.cpp
View file @
9c038180
...
...
@@ -671,6 +671,9 @@ bool Parser::parseAsmDefinition(DeclarationAST *&node)
bool
Parser
::
parseAsmOperandList
()
{
if
(
LA
()
!=
T_STRING_LITERAL
)
return
true
;
if
(
parseAsmOperand
())
{
while
(
LA
()
==
T_COMMA
)
{
consumeToken
();
...
...
@@ -678,6 +681,7 @@ bool Parser::parseAsmOperandList()
}
return
true
;
}
return
false
;
}
...
...
@@ -949,6 +953,14 @@ bool Parser::parseDeclaratorOrAbstractDeclarator(DeclaratorAST *&node)
bool
Parser
::
parseCoreDeclarator
(
DeclaratorAST
*&
node
)
{
unsigned
start
=
cursor
();
SpecifierAST
*
attributes
=
0
;
SpecifierAST
**
attribute_ptr
=
&
attributes
;
while
(
LA
()
==
T___ATTRIBUTE__
)
{
parseAttributeSpecifier
(
*
attribute_ptr
);
attribute_ptr
=
&
(
*
attribute_ptr
)
->
next
;
}
PtrOperatorAST
*
ptr_operators
=
0
,
**
ptr_operators_tail
=
&
ptr_operators
;
while
(
parsePtrOperator
(
*
ptr_operators_tail
))
ptr_operators_tail
=
&
(
*
ptr_operators_tail
)
->
next
;
...
...
@@ -960,12 +972,16 @@ bool Parser::parseCoreDeclarator(DeclaratorAST *&node)
DeclaratorIdAST
*
declarator_id
=
new
(
_pool
)
DeclaratorIdAST
;
declarator_id
->
name
=
name
;
DeclaratorAST
*
ast
=
new
(
_pool
)
DeclaratorAST
;
ast
->
attributes
=
attributes
;
ast
->
ptr_operators
=
ptr_operators
;
ast
->
core_declarator
=
declarator_id
;
node
=
ast
;
return
true
;
}
}
else
if
(
LA
()
==
T_LPAREN
)
{
if
(
attributes
)
_translationUnit
->
warning
(
attributes
->
firstToken
(),
"unexpected attribtues"
);
unsigned
lparen_token
=
consumeToken
();
DeclaratorAST
*
declarator
=
0
;
if
(
parseDeclarator
(
declarator
)
&&
LA
()
==
T_RPAREN
)
{
...
...
@@ -980,6 +996,7 @@ bool Parser::parseCoreDeclarator(DeclaratorAST *&node)
return
true
;
}
}
rewind
(
start
);
return
false
;
}
...
...
@@ -1060,7 +1077,7 @@ bool Parser::parseDeclarator(DeclaratorAST *&node, bool stopAtCppInitializer)
break
;
}
SpecifierAST
**
spec_ptr
=
&
node
->
attributes
;
SpecifierAST
**
spec_ptr
=
&
node
->
post_
attributes
;
while
(
LA
()
==
T___ATTRIBUTE__
)
{
parseAttributeSpecifier
(
*
spec_ptr
);
spec_ptr
=
&
(
*
spec_ptr
)
->
next
;
...
...
tests/manual/cplusplus/conf.c++
View file @
9c038180
...
...
@@ -6,3 +6,6 @@
#define restrict
#define __restrict
#define __weak
#define __builtin_va_arg(a,b) ((b)0)
#define __stdcall
#define __fastcall
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