Propagate a DeclContext through NameBinding for IdentifierTypes.

Swift SVN r1803
This commit is contained in:
Eli Friedman
2012-05-10 23:34:01 +00:00
parent d10f2b62b7
commit 05fe3c907f
4 changed files with 11 additions and 10 deletions

View File

@@ -138,12 +138,13 @@ public:
class TranslationUnit : public Module {
public:
typedef std::pair<Module::AccessPathTy, Module*> ImportedModule;
typedef std::pair<IdentifierType*, DeclContext*> IdentTypeAndContext;
typedef std::pair<TupleType*, DeclContext*> TupleTypeAndContext;
private:
/// UnresolvedIdentifierTypes - This is a list of scope-qualified dotted types
/// that were unresolved at the end of the translation unit's parse
/// phase.
ArrayRef<IdentifierType*> UnresolvedIdentifierTypes;
ArrayRef<IdentTypeAndContext> UnresolvedIdentifierTypes;
/// UnresolvedIdentifierTypes - This is a list of tuples containing a default
/// value expression, along with the context containing the type with the
@@ -167,16 +168,16 @@ public:
/// getUnresolvedIdentifierTypes - This is a list of scope-qualified types
/// that were unresolved at the end of the translation unit's parse
/// phase.
ArrayRef<IdentifierType*> getUnresolvedIdentifierTypes() const {
ArrayRef<IdentTypeAndContext> getUnresolvedIdentifierTypes() const {
assert(ASTStage == Parsed);
return UnresolvedIdentifierTypes;
}
void setUnresolvedIdentifierTypes(ArrayRef<IdentifierType*> T) {
void setUnresolvedIdentifierTypes(ArrayRef<IdentTypeAndContext> T) {
assert(ASTStage == Parsing);
UnresolvedIdentifierTypes = T;
}
void clearUnresolvedIdentifierTypes() {
UnresolvedIdentifierTypes = ArrayRef<IdentifierType*>();
UnresolvedIdentifierTypes = ArrayRef<IdentTypeAndContext>();
}
ArrayRef<TupleTypeAndContext> getTypesWithDefaultValues() const {