implement ParseParamDeclaratorType in the ast builder
llvm-svn: 39231
This commit is contained in:
parent
cbc426d4f7
commit
216d8654fd
|
@ -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.
|
||||
//
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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.
|
||||
//
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ public:
|
|||
return 0;
|
||||
}
|
||||
|
||||
virtual TypeResult ParseParamDeclaratorType(Declarator &D) {
|
||||
virtual TypeResult ParseParamDeclaratorType(Scope *S, Declarator &D) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue