We can now parse and remember the distinction between:

'unsigned char' and 'unsigned char const'.

-Chris

llvm-svn: 39172
This commit is contained in:
Chris Lattner 2006-11-12 00:05:06 +00:00
parent 8ddf65053e
commit aecbefa519
3 changed files with 19 additions and 6 deletions

View File

@ -131,7 +131,6 @@ static TypeRef ConvertDeclSpecToType(const DeclSpec &DS, ASTContext &Ctx) {
//DeclSpec::TST_union:
//DeclSpec::TST_struct:
//DeclSpec::TST_typedef:
}
}
@ -140,7 +139,8 @@ static TypeRef ConvertDeclSpecToType(const DeclSpec &DS, ASTContext &Ctx) {
TypeRef Sema::GetTypeForDeclarator(Declarator &D, Scope *S) {
TypeRef T = ConvertDeclSpecToType(D.getDeclSpec(), Context);
// FIXME: Apply const/volatile/restrict qualifiers to T.
// Apply const/volatile/restrict qualifiers to T.
T = T.getQualifiedType(D.getDeclSpec().TypeQualifiers);
return T;
return TypeRef();

View File

@ -131,7 +131,6 @@ static TypeRef ConvertDeclSpecToType(const DeclSpec &DS, ASTContext &Ctx) {
//DeclSpec::TST_union:
//DeclSpec::TST_struct:
//DeclSpec::TST_typedef:
}
}
@ -140,7 +139,8 @@ static TypeRef ConvertDeclSpecToType(const DeclSpec &DS, ASTContext &Ctx) {
TypeRef Sema::GetTypeForDeclarator(Declarator &D, Scope *S) {
TypeRef T = ConvertDeclSpecToType(D.getDeclSpec(), Context);
// FIXME: Apply const/volatile/restrict qualifiers to T.
// Apply const/volatile/restrict qualifiers to T.
T = T.getQualifiedType(D.getDeclSpec().TypeQualifiers);
return T;
return TypeRef();

View File

@ -51,12 +51,16 @@ public:
ThePtr |= Quals;
}
Type *getTypePtr() const {
return reinterpret_cast<Type*>(ThePtr & ~CVRFlags);
}
Type &operator*() const {
return *reinterpret_cast<Type*>(ThePtr & ~CVRFlags);
return *getTypePtr();
}
Type *operator->() const {
return reinterpret_cast<Type*>(ThePtr & ~CVRFlags);
return getTypePtr();
}
/// isNull - Return true if this TypeRef doesn't point to a type yet.
@ -77,6 +81,15 @@ public:
return ThePtr & CVRFlags;
}
TypeRef getQualifiedType(unsigned TQs) const {
return TypeRef(getTypePtr(), TQs);
}
TypeRef getUnqualifiedType() const {
return TypeRef(getTypePtr());
}
void dump() const;
};