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
3b113a2d
Commit
3b113a2d
authored
May 20, 2010
by
Roberto Raggi
Browse files
Deprecate the old template instantiation.
parent
e07c3401
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/GenTemplateInstance.cpp
→
src/libs/cplusplus/
Deprecated
GenTemplateInstance.cpp
View file @
3b113a2d
...
...
@@ -27,7 +27,7 @@
**
**************************************************************************/
#include
"GenTemplateInstance.h"
#include
"
Deprecated
GenTemplateInstance.h"
#include
"Overview.h"
#include
<Control.h>
...
...
@@ -47,7 +47,7 @@ namespace {
class
ApplySubstitution
{
public:
ApplySubstitution
(
Control
*
control
,
Symbol
*
symbol
,
const
GenTemplateInstance
::
Substitution
&
substitution
);
ApplySubstitution
(
Control
*
control
,
Symbol
*
symbol
,
const
Deprecated
GenTemplateInstance
::
Substitution
&
substitution
);
~
ApplySubstitution
();
inline
Control
*
control
()
const
{
return
_control
;
}
...
...
@@ -311,13 +311,13 @@ private:
public:
// attributes
Control
*
_control
;
Symbol
*
symbol
;
GenTemplateInstance
::
Substitution
substitution
;
Deprecated
GenTemplateInstance
::
Substitution
substitution
;
ApplyToType
applyToType
;
ApplyToName
applyToName
;
};
ApplySubstitution
::
ApplySubstitution
(
Control
*
control
,
Symbol
*
symbol
,
const
GenTemplateInstance
::
Substitution
&
substitution
)
const
Deprecated
GenTemplateInstance
::
Substitution
&
substitution
)
:
_control
(
control
),
symbol
(
symbol
),
substitution
(
substitution
),
applyToType
(
this
),
applyToName
(
this
)
...
...
@@ -363,24 +363,24 @@ FullySpecifiedType ApplySubstitution::applySubstitution(int index) const
}
// end of anonymous namespace
GenTemplateInstance
::
GenTemplateInstance
(
Control
*
control
,
const
Substitution
&
substitution
)
Deprecated
GenTemplateInstance
::
Deprecated
GenTemplateInstance
(
Control
*
control
,
const
Substitution
&
substitution
)
:
_symbol
(
0
),
_control
(
control
),
_substitution
(
substitution
)
{
}
FullySpecifiedType
GenTemplateInstance
::
gen
(
Symbol
*
symbol
)
FullySpecifiedType
Deprecated
GenTemplateInstance
::
gen
(
Symbol
*
symbol
)
{
ApplySubstitution
o
(
_control
,
symbol
,
_substitution
);
return
o
.
apply
(
symbol
->
type
());
}
FullySpecifiedType
GenTemplateInstance
::
instantiate
(
const
Name
*
className
,
Symbol
*
candidate
,
Control
*
control
)
FullySpecifiedType
Deprecated
GenTemplateInstance
::
instantiate
(
const
Name
*
className
,
Symbol
*
candidate
,
Control
*
control
)
{
if
(
className
)
{
if
(
const
TemplateNameId
*
templId
=
className
->
asTemplateNameId
())
{
if
(
Class
*
klass
=
candidate
->
enclosingSymbol
()
->
asClass
())
{
GenTemplateInstance
::
Substitution
subst
;
Deprecated
GenTemplateInstance
::
Substitution
subst
;
for
(
unsigned
i
=
0
;
i
<
templId
->
templateArgumentCount
();
++
i
)
{
FullySpecifiedType
templArgTy
=
templId
->
templateArgumentAt
(
i
);
...
...
@@ -395,7 +395,7 @@ FullySpecifiedType GenTemplateInstance::instantiate(const Name *className, Symbo
}
}
GenTemplateInstance
inst
(
control
,
subst
);
Deprecated
GenTemplateInstance
inst
(
control
,
subst
);
return
inst
.
gen
(
candidate
);
}
}
...
...
src/libs/cplusplus/GenTemplateInstance.h
→
src/libs/cplusplus/
Deprecated
GenTemplateInstance.h
View file @
3b113a2d
...
...
@@ -27,8 +27,8 @@
**
**************************************************************************/
#ifndef GENTEMPLATEINSTANCE_H
#define GENTEMPLATEINSTANCE_H
#ifndef
CPLUSPLUS_DEPRECATED
GENTEMPLATEINSTANCE_H
#define
CPLUSPLUS_DEPRECATED
GENTEMPLATEINSTANCE_H
#include
<TypeVisitor.h>
#include
<NameVisitor.h>
...
...
@@ -41,7 +41,7 @@
namespace
CPlusPlus
{
class
CPLUSPLUS_EXPORT
GenTemplateInstance
class
CPLUSPLUS_EXPORT
Deprecated
GenTemplateInstance
{
public:
typedef
QList
<
QPair
<
const
Identifier
*
,
FullySpecifiedType
>
>
Substitution
;
...
...
@@ -50,7 +50,7 @@ public:
static
FullySpecifiedType
instantiate
(
const
Name
*
className
,
Symbol
*
candidate
,
Control
*
control
);
private:
GenTemplateInstance
(
Control
*
control
,
const
Substitution
&
substitution
);
Deprecated
GenTemplateInstance
(
Control
*
control
,
const
Substitution
&
substitution
);
FullySpecifiedType
gen
(
Symbol
*
symbol
);
private:
...
...
@@ -61,4 +61,4 @@ private:
}
// end of namespace CPlusPlus
#endif // GENTEMPLATEINSTANCE_H
#endif //
CPLUSPLUS_DEPRECATED
GENTEMPLATEINSTANCE_H
src/libs/cplusplus/LookupContext.cpp
View file @
3b113a2d
...
...
@@ -31,7 +31,7 @@
#include
"ResolveExpression.h"
#include
"Overview.h"
#include
"CppBindings.h"
#include
"GenTemplateInstance.h"
#include
"
Deprecated
GenTemplateInstance.h"
#include
<CoreTypes.h>
#include
<Symbols.h>
...
...
src/libs/cplusplus/ResolveExpression.cpp
View file @
3b113a2d
...
...
@@ -30,7 +30,7 @@
#include
"ResolveExpression.h"
#include
"LookupContext.h"
#include
"Overview.h"
#include
"GenTemplateInstance.h"
#include
"
Deprecated
GenTemplateInstance.h"
#include
<Control.h>
#include
<AST.h>
...
...
@@ -604,7 +604,7 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas
foreach
(
Symbol
*
overload
,
binding
->
find
(
arrowOp
))
{
if
(
overload
->
type
()
->
isFunctionType
())
{
FullySpecifiedType
overloadTy
=
GenTemplateInstance
::
instantiate
(
binding
->
templateId
(),
overload
,
control
());
FullySpecifiedType
overloadTy
=
Deprecated
GenTemplateInstance
::
instantiate
(
binding
->
templateId
(),
overload
,
control
());
Function
*
instantiatedFunction
=
overloadTy
->
asFunctionType
();
Q_ASSERT
(
instantiatedFunction
!=
0
);
...
...
@@ -641,7 +641,7 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas
FullySpecifiedType
ResolveExpression
::
instantiate
(
const
Name
*
className
,
Symbol
*
candidate
)
const
{
return
GenTemplateInstance
::
instantiate
(
className
,
candidate
,
_context
.
control
());
return
Deprecated
GenTemplateInstance
::
instantiate
(
className
,
candidate
,
_context
.
control
());
}
bool
ResolveExpression
::
visit
(
PostIncrDecrAST
*
)
...
...
src/libs/cplusplus/cplusplus-lib.pri
View file @
3b113a2d
...
...
@@ -39,7 +39,7 @@ HEADERS += \
$$PWD/DeprecatedLookupContext.h \
$$PWD/CppBindings.h \
$$PWD/ASTParent.h \
$$PWD/GenTemplateInstance.h \
$$PWD/
Deprecated
GenTemplateInstance.h \
$$PWD/FindUsages.h \
$$PWD/CheckUndefinedSymbols.h \
$$PWD/DependencyTable.h \
...
...
@@ -66,7 +66,7 @@ SOURCES += \
$$PWD/DeprecatedLookupContext.cpp \
$$PWD/CppBindings.cpp \
$$PWD/ASTParent.cpp \
$$PWD/GenTemplateInstance.cpp \
$$PWD/
Deprecated
GenTemplateInstance.cpp \
$$PWD/FindUsages.cpp \
$$PWD/CheckUndefinedSymbols.cpp \
$$PWD/DependencyTable.cpp \
...
...
tests/auto/cplusplus/semantic/tst_semantic.cpp
View file @
3b113a2d
...
...
@@ -15,7 +15,7 @@
#include
<Names.h>
#include
<Literals.h>
#include
<DiagnosticClient.h>
#include
<GenTemplateInstance.h>
#include
<
Deprecated
GenTemplateInstance.h>
#include
<Overview.h>
#include
<ExpressionUnderCursor.h>
#include
<Names.h>
...
...
@@ -436,7 +436,7 @@ void tst_Semantic::template_instance_1()
FullySpecifiedType
templArgs
[]
=
{
control
.
integerType
(
IntegerType
::
Int
)
};
const
Name
*
templId
=
control
.
templateNameId
(
control
.
findOrInsertIdentifier
(
"QList"
),
templArgs
,
1
);
FullySpecifiedType
genTy
=
GenTemplateInstance
::
instantiate
(
templId
,
decl
,
&
control
);
FullySpecifiedType
genTy
=
Deprecated
GenTemplateInstance
::
instantiate
(
templId
,
decl
,
&
control
);
Overview
oo
;
oo
.
setShowReturnTypes
(
true
);
...
...
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