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
Tobias Hunger
qt-creator
Commits
8a32c41f
Commit
8a32c41f
authored
Aug 11, 2010
by
Roberto Raggi
Browse files
Removed TemplateArgumentList
parent
f3746289
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/FindUsages.cpp
View file @
8a32c41f
...
...
@@ -1830,7 +1830,7 @@ bool FindUsages::visit(QualifiedNameAST *ast)
template_id
=
class_or_namespace_name
->
asTemplateId
();
if
(
template_id
)
{
for
(
TemplateArgument
ListAST
*
arg_it
=
template_id
->
template_argument_list
;
arg_it
;
arg_it
=
arg_it
->
next
)
{
for
(
Expression
ListAST
*
arg_it
=
template_id
->
template_argument_list
;
arg_it
;
arg_it
=
arg_it
->
next
)
{
this
->
expression
(
arg_it
->
value
);
}
}
...
...
@@ -1863,7 +1863,7 @@ bool FindUsages::visit(QualifiedNameAST *ast)
if
(
template_id
)
{
identifier_token
=
template_id
->
identifier_token
;
for
(
TemplateArgument
ListAST
*
template_arguments
=
template_id
->
template_argument_list
;
for
(
Expression
ListAST
*
template_arguments
=
template_id
->
template_argument_list
;
template_arguments
;
template_arguments
=
template_arguments
->
next
)
{
this
->
expression
(
template_arguments
->
value
);
}
...
...
src/shared/cplusplus/AST.h
View file @
8a32c41f
...
...
@@ -2216,7 +2216,7 @@ class CPLUSPLUS_EXPORT TemplateIdAST: public NameAST
public:
unsigned
identifier_token
;
unsigned
less_token
;
TemplateArgument
ListAST
*
template_argument_list
;
Expression
ListAST
*
template_argument_list
;
unsigned
greater_token
;
public:
...
...
src/shared/cplusplus/ASTClone.cpp
View file @
8a32c41f
...
...
@@ -804,9 +804,9 @@ TemplateIdAST *TemplateIdAST::clone(MemoryPool *pool) const
TemplateIdAST
*
ast
=
new
(
pool
)
TemplateIdAST
;
ast
->
identifier_token
=
identifier_token
;
ast
->
less_token
=
less_token
;
for
(
TemplateArgument
ListAST
*
iter
=
template_argument_list
,
**
ast_iter
=
&
ast
->
template_argument_list
;
for
(
Expression
ListAST
*
iter
=
template_argument_list
,
**
ast_iter
=
&
ast
->
template_argument_list
;
iter
;
iter
=
iter
->
next
,
ast_iter
=
&
(
*
ast_iter
)
->
next
)
*
ast_iter
=
new
(
pool
)
TemplateArgument
ListAST
((
iter
->
value
)
?
iter
->
value
->
clone
(
pool
)
:
0
);
*
ast_iter
=
new
(
pool
)
Expression
ListAST
((
iter
->
value
)
?
iter
->
value
->
clone
(
pool
)
:
0
);
ast
->
greater_token
=
greater_token
;
return
ast
;
}
...
...
src/shared/cplusplus/ASTfwd.h
View file @
8a32c41f
...
...
@@ -234,8 +234,6 @@ typedef List<ObjCPropertyAttributeAST *> ObjCPropertyAttributeListAST;
typedef
List
<
ObjCMessageArgumentDeclarationAST
*>
ObjCMessageArgumentDeclarationListAST
;
typedef
List
<
ObjCSynthesizedPropertyAST
*>
ObjCSynthesizedPropertyListAST
;
typedef
ExpressionListAST
TemplateArgumentListAST
;
}
// end of namespace CPlusPlus
...
...
src/shared/cplusplus/CheckName.cpp
View file @
8a32c41f
...
...
@@ -356,7 +356,7 @@ bool CheckName::visit(TemplateIdAST *ast)
{
const
Identifier
*
id
=
identifier
(
ast
->
identifier_token
);
std
::
vector
<
FullySpecifiedType
>
templateArguments
;
for
(
TemplateArgument
ListAST
*
it
=
ast
->
template_argument_list
;
it
;
for
(
Expression
ListAST
*
it
=
ast
->
template_argument_list
;
it
;
it
=
it
->
next
)
{
ExpressionAST
*
arg
=
it
->
value
;
FullySpecifiedType
exprTy
=
semantic
()
->
check
(
arg
,
_scope
);
...
...
src/shared/cplusplus/Parser.cpp
View file @
8a32c41f
...
...
@@ -818,7 +818,7 @@ Parser::TemplateArgumentListEntry *Parser::templateArgumentListEntry(unsigned to
return
0
;
}
bool
Parser
::
parseTemplateArgumentList
(
TemplateArgument
ListAST
*&
node
)
bool
Parser
::
parseTemplateArgumentList
(
Expression
ListAST
*&
node
)
{
DEBUG_THIS_RULE
();
...
...
@@ -830,10 +830,10 @@ bool Parser::parseTemplateArgumentList(TemplateArgumentListAST *&node)
unsigned
start
=
cursor
();
TemplateArgument
ListAST
**
template_argument_ptr
=
&
node
;
Expression
ListAST
**
template_argument_ptr
=
&
node
;
ExpressionAST
*
template_argument
=
0
;
if
(
parseTemplateArgument
(
template_argument
))
{
*
template_argument_ptr
=
new
(
_pool
)
TemplateArgument
ListAST
;
*
template_argument_ptr
=
new
(
_pool
)
Expression
ListAST
;
(
*
template_argument_ptr
)
->
value
=
template_argument
;
template_argument_ptr
=
&
(
*
template_argument_ptr
)
->
next
;
...
...
@@ -844,7 +844,7 @@ bool Parser::parseTemplateArgumentList(TemplateArgumentListAST *&node)
consumeToken
();
// consume T_COMMA
if
(
parseTemplateArgument
(
template_argument
))
{
*
template_argument_ptr
=
new
(
_pool
)
TemplateArgument
ListAST
;
*
template_argument_ptr
=
new
(
_pool
)
Expression
ListAST
;
(
*
template_argument_ptr
)
->
value
=
template_argument
;
template_argument_ptr
=
&
(
*
template_argument_ptr
)
->
next
;
...
...
@@ -855,10 +855,10 @@ bool Parser::parseTemplateArgumentList(TemplateArgumentListAST *&node)
if
(
_pool
!=
_translationUnit
->
memoryPool
())
{
MemoryPool
*
pool
=
_translationUnit
->
memoryPool
();
TemplateArgument
ListAST
*
template_argument_list
=
node
;
for
(
TemplateArgument
ListAST
*
iter
=
template_argument_list
,
**
ast_iter
=
&
node
;
Expression
ListAST
*
template_argument_list
=
node
;
for
(
Expression
ListAST
*
iter
=
template_argument_list
,
**
ast_iter
=
&
node
;
iter
;
iter
=
iter
->
next
,
ast_iter
=
&
(
*
ast_iter
)
->
next
)
*
ast_iter
=
new
(
pool
)
TemplateArgument
ListAST
((
iter
->
value
)
?
iter
->
value
->
clone
(
pool
)
:
0
);
*
ast_iter
=
new
(
pool
)
Expression
ListAST
((
iter
->
value
)
?
iter
->
value
->
clone
(
pool
)
:
0
);
}
_templateArgumentList
.
insert
(
std
::
make_pair
(
start
,
TemplateArgumentListEntry
(
start
,
cursor
(),
node
)));
...
...
@@ -4117,7 +4117,7 @@ bool Parser::parseNameId(NameAST *&name)
else
if
(
LA
()
==
T_LPAREN
)
{
// a template-id followed by a T_LPAREN
if
(
TemplateArgument
ListAST
*
template_arguments
=
template_id
->
template_argument_list
)
{
if
(
Expression
ListAST
*
template_arguments
=
template_id
->
template_argument_list
)
{
if
(
!
template_arguments
->
next
&&
template_arguments
->
value
&&
template_arguments
->
value
->
asBinaryExpression
())
{
...
...
src/shared/cplusplus/Parser.h
View file @
8a32c41f
...
...
@@ -184,7 +184,7 @@ public:
bool
parseStringLiteral
(
ExpressionAST
*&
node
);
bool
parseSwitchStatement
(
StatementAST
*&
node
);
bool
parseTemplateArgument
(
ExpressionAST
*&
node
);
bool
parseTemplateArgumentList
(
TemplateArgument
ListAST
*&
node
);
bool
parseTemplateArgumentList
(
Expression
ListAST
*&
node
);
bool
parseTemplateDeclaration
(
DeclarationAST
*&
node
);
bool
parseTemplateParameter
(
DeclarationAST
*&
node
);
bool
parseTemplateParameterList
(
DeclarationListAST
*&
node
);
...
...
@@ -319,9 +319,9 @@ public:
struct
TemplateArgumentListEntry
{
unsigned
index
;
unsigned
cursor
;
TemplateArgument
ListAST
*
ast
;
Expression
ListAST
*
ast
;
TemplateArgumentListEntry
(
unsigned
index
=
0
,
unsigned
cursor
=
0
,
TemplateArgument
ListAST
*
ast
=
0
)
TemplateArgumentListEntry
(
unsigned
index
=
0
,
unsigned
cursor
=
0
,
Expression
ListAST
*
ast
=
0
)
:
index
(
index
),
cursor
(
cursor
),
ast
(
ast
)
{}
};
...
...
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