diff --git a/cmd/genbindings/clang2il.go b/cmd/genbindings/clang2il.go index fc663833..9997226c 100644 --- a/cmd/genbindings/clang2il.go +++ b/cmd/genbindings/clang2il.go @@ -212,11 +212,6 @@ func processClassType(node map[string]interface{}, addNamePrefix string) (CppCla log.Printf("-> Processing class %q...\n", nodename) - // Also skip over any custom exceptions - if !AllowClass(nodename) { - return CppClass{}, ErrNoContent - } - // Skip over forward class declarations // This is determined in two ways: // 1. If the class has no inner nodes diff --git a/cmd/genbindings/transformblocklist.go b/cmd/genbindings/transformblocklist.go index 23ea14bc..83295991 100644 --- a/cmd/genbindings/transformblocklist.go +++ b/cmd/genbindings/transformblocklist.go @@ -4,6 +4,23 @@ package main // and entire classes that may be disallowed. func astTransformBlocklist(parsed *CppParsedHeader) { + // Whole-classes + + j := 0 + for _, c := range parsed.Classes { + if !AllowClass(c.ClassName) { + continue + } + + // Keep + parsed.Classes[j] = c + j++ + } + parsed.Classes = parsed.Classes[:j] // reslice + + // For the kept classes, filter ctors and methods within the class, based + // on the parameter types and return types + for i, c := range parsed.Classes { // Constructors