public override bool VisitFunctionDecl(Function function) { if (!VisitDeclaration(function)) { return(false); } // push function declaration as current scope for parameters and return type DeclarationStack.Push(function); try { function.Attributes.Add(SuppressUnmanagedSecAttrib); ApplyDllImportAttribute(function); QualifiedType returnType = function.ReturnType; if (returnType.Type != null) { VisitReturnType(( FunctionType )function.FunctionType.Type); } foreach (Parameter parameter in function.Parameters) { parameter.Visit(this); } return(true); } finally { DeclarationStack.Pop( ); } }
// visit delegate types by pushing the type onto the declaration stack // as the current scope for parameter handling etc... The typedef for // a function pointer has the name (FunctionType has no name ) public override bool VisitTypedefDecl(TypedefDecl typedef) { if (typedef.IsDelegateTypeDef( )) { DeclarationStack.Push(typedef); try { return(base.VisitTypedefDecl(typedef)); } finally { DeclarationStack.Pop( ); } } return(true); }