implement ParseParamDeclaratorType in the ast builder

llvm-svn: 39231
This commit is contained in:
Chris Lattner 2006-12-02 06:47:41 +00:00
parent cbc426d4f7
commit 216d8654fd
6 changed files with 31 additions and 2 deletions

View File

@ -58,6 +58,8 @@ public:
virtual TypeResult ParseTypeName(Scope *S, Declarator &D);
virtual TypeResult ParseParamDeclaratorType(Scope *S, Declarator &D);
//===--------------------------------------------------------------------===//
// Symbol table / Decl tracking callbacks: SemaDecl.cpp.
//

View File

@ -146,3 +146,15 @@ Sema::TypeResult Sema::ParseTypeName(Scope *S, Declarator &D) {
return T.getAsOpaquePtr();
}
Sema::TypeResult Sema::ParseParamDeclaratorType(Scope *S, Declarator &D) {
// Note: parameters have identifiers, but we don't care about them here, we
// just want the type converted.
TypeRef T = GetTypeForDeclarator(D, S);
// If the type of the declarator was invalid, this is an invalid typename.
if (T.isNull())
return true;
return T.getAsOpaquePtr();
}

View File

@ -1022,7 +1022,8 @@ void Parser::ParseParenDeclarator(Declarator &D) {
// Inform the actions module about the parameter declarator, so it gets
// added to the current scope.
Action::TypeResult ParamTy = Actions.ParseParamDeclaratorType(ParmDecl);
Action::TypeResult ParamTy =
Actions.ParseParamDeclaratorType(CurScope, ParmDecl);
// Remember this parsed parameter in ParamInfo.
ParamInfo.push_back(DeclaratorChunk::ParamInfo(ParmDecl.getIdentifier(),

View File

@ -58,6 +58,8 @@ public:
virtual TypeResult ParseTypeName(Scope *S, Declarator &D);
virtual TypeResult ParseParamDeclaratorType(Scope *S, Declarator &D);
//===--------------------------------------------------------------------===//
// Symbol table / Decl tracking callbacks: SemaDecl.cpp.
//

View File

@ -146,3 +146,15 @@ Sema::TypeResult Sema::ParseTypeName(Scope *S, Declarator &D) {
return T.getAsOpaquePtr();
}
Sema::TypeResult Sema::ParseParamDeclaratorType(Scope *S, Declarator &D) {
// Note: parameters have identifiers, but we don't care about them here, we
// just want the type converted.
TypeRef T = GetTypeForDeclarator(D, S);
// If the type of the declarator was invalid, this is an invalid typename.
if (T.isNull())
return true;
return T.getAsOpaquePtr();
}

View File

@ -136,7 +136,7 @@ public:
return 0;
}
virtual TypeResult ParseParamDeclaratorType(Declarator &D) {
virtual TypeResult ParseParamDeclaratorType(Scope *S, Declarator &D) {
return 0;
}