forked from qt-creator/qt-creator
Sorry this was not supposed to be committed.
Revert "Revert "Try to fix the type rewriter.""
This reverts commit c9bc1e7c64.
This commit is contained in:
@@ -51,51 +51,27 @@ public:
|
||||
class CPLUSPLUS_EXPORT SubstitutionEnvironment
|
||||
{
|
||||
Q_DISABLE_COPY(SubstitutionEnvironment)
|
||||
QList<Substitution *> substs;
|
||||
|
||||
public:
|
||||
SubstitutionEnvironment() {}
|
||||
SubstitutionEnvironment();
|
||||
|
||||
FullySpecifiedType apply(const Name *name, Rewrite *rewrite) const
|
||||
{
|
||||
if (name) {
|
||||
for (int index = substs.size() - 1; index != -1; --index) {
|
||||
const Substitution *subst = substs.at(index);
|
||||
FullySpecifiedType apply(const Name *name, Rewrite *rewrite) const;
|
||||
|
||||
FullySpecifiedType ty = subst->apply(name, rewrite);
|
||||
if (! ty->isUndefinedType())
|
||||
return ty;
|
||||
}
|
||||
}
|
||||
void enter(Substitution *subst);
|
||||
void leave();
|
||||
|
||||
return FullySpecifiedType();
|
||||
}
|
||||
Scope *scope() const;
|
||||
Scope *switchScope(Scope *scope);
|
||||
|
||||
void enter(Substitution *subst)
|
||||
{
|
||||
substs.append(subst);
|
||||
}
|
||||
|
||||
void leave()
|
||||
{
|
||||
substs.removeLast();
|
||||
}
|
||||
};
|
||||
|
||||
class CPLUSPLUS_EXPORT ContextSubstitution: public Substitution
|
||||
{
|
||||
public:
|
||||
ContextSubstitution(const LookupContext &context, Scope *scope);
|
||||
virtual ~ContextSubstitution();
|
||||
|
||||
virtual FullySpecifiedType apply(const Name *name, Rewrite *rewrite) const;
|
||||
const LookupContext &context() const;
|
||||
void setContext(const LookupContext &context);
|
||||
|
||||
private:
|
||||
LookupContext _context;
|
||||
QList<Substitution *> _substs;
|
||||
Scope *_scope;
|
||||
LookupContext _context;
|
||||
};
|
||||
|
||||
|
||||
class CPLUSPLUS_EXPORT SubstitutionMap: public Substitution
|
||||
{
|
||||
public:
|
||||
@@ -109,6 +85,17 @@ private:
|
||||
QList<QPair<const Name *, FullySpecifiedType> > _map;
|
||||
};
|
||||
|
||||
class CPLUSPLUS_EXPORT UseQualifiedNames: public Substitution
|
||||
{
|
||||
public:
|
||||
UseQualifiedNames();
|
||||
virtual ~UseQualifiedNames();
|
||||
|
||||
virtual FullySpecifiedType apply(const Name *name, Rewrite *rewrite) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
CPLUSPLUS_EXPORT FullySpecifiedType rewriteType(const FullySpecifiedType &type,
|
||||
SubstitutionEnvironment *env,
|
||||
Control *control);
|
||||
|
||||
Reference in New Issue
Block a user