Move ActOnTypeAlias to SemaDecl since a type alias *is* a decl that *installs* a type. Add some fixme's and rename some junk in ASTContext relating to the typemap. Diagnose redefinitions of named types. Install a typemap entry when a data declaration is defined.

We can now declare variables to be of data type.

Swift SVN r178
This commit is contained in:
Chris Lattner
2010-10-09 22:01:25 +00:00
parent 9ba168ace5
commit ac855b690b
7 changed files with 45 additions and 24 deletions

View File

@@ -77,16 +77,18 @@ public:
/// no type with the specified name exists, null is returned.
///
/// FIXME: This is a total hack since we don't have scopes for types.
/// getNamedType should eventually be replaced.
/// getNamedType should eventually be replaced. At that point, the "install"
/// functions should move out of here.
Type *getNamedType(Identifier Name);
/// getAliasType - Return a new alias type. This returns null if there is a
/// conflict with an already existing alias type of the same name.
AliasType *getAliasType(Identifier Name, Type *Underlying);
/// getAliasType - Add a new alias type to the named type map. This returns
/// null if there is a conflict with an already existing alias type of the
/// same name.
void InstallAliasType(Identifier Name, Type *Underlying);
/// getDataType - Return the type corresponding to the specified data
/// InstallDataType - Return the type corresponding to the specified data
/// declaration.
DataType *getDataType(DataDecl *TheDecl);
void InstallDataType(DataDecl *TheDecl);
/// getTupleType - Return the uniqued tuple type with the specified elements.
TupleType *getTupleType(const TupleTypeElt *Fields,