Skip to content

Commit 58f17aa

Browse files
committed
generate: Progress on functions;
1 parent d526050 commit 58f17aa

File tree

842 files changed

+125985
-6117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

842 files changed

+125985
-6117
lines changed

.failed

Whitespace-only changes.

.output

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Generating corefoundation...

.pkgs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
go generate -v -x ./macos/corefoundation &
2+
wait

.rere

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
time . .pkgs > .output; cat .output |grep TypeFrom |grep failed |tee .failed
2+
echo done

failures

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TypeFromSymbol: failed to parse OSStatus AudioQueueProcessingTapNew(AudioQueueRef inAQ, AudioQueueProcessingTapCallback inCallback, void *inClientData, AudioQueueProcessingTapFlags inFlags, UInt32 *outMaxFrames, AudioStreamBasicDescription *outProcessingFormat, AudioQueueProcessingTapRef _Nullable *outAQTap);: found IDENT ("inClientData"), expected token ) at {0 106}

generate/codegen/gen_function.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package codegen
22

33
import (
44
"fmt"
5+
"log"
56
"strings"
67

78
"github.com/progrium/macdriver/internal/set"
@@ -29,8 +30,14 @@ type Function struct {
2930

3031
// GoArgs return go function args
3132
func (f *Function) GoArgs(currentModule *modules.Module) string {
33+
log.Println("rendering function", f.Name)
3234
var args []string
3335
for _, p := range f.Parameters {
36+
log.Println("rendering function", f.Name, p.Name, p.Type)
37+
log.Printf("type: %T", p.Type)
38+
if pt, ok := p.Type.(*typing.PointerType); ok {
39+
log.Printf("ptr type: %T", pt.Type)
40+
}
3441
args = append(args, fmt.Sprintf("%s %s", p.Name, p.Type.GoName(currentModule, true)))
3542
}
3643
return strings.Join(args, ", ")

generate/function.go

Lines changed: 237 additions & 46 deletions
Large diffs are not rendered by default.

generate/generator.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ func (db *Generator) Generate(platform string, version int, rootDir string, fram
109109
case "Function":
110110
fn := db.ToFunction(framework, s)
111111
if fn == nil {
112-
log.Println("skipping function", s.Name)
113112
continue
114113
}
115114
mw.Functions = append(mw.Functions, fn)

generate/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ func (db *Generator) TypeFromSymbol(sym Symbol) typing.Type {
9797
typ, err := sym.Parse()
9898
if err != nil {
9999
fmt.Printf("TypeFromSymbol: failed to parse %s: %s\n", sym.Declaration, err)
100-
panic("bad function")
100+
panic("bad function decl")
101101
}
102102
fn := typ.Function
103103
if fn == nil {
104104
fmt.Printf("TypeFromSymbol: name=%s declaration=%s\n", sym.Name, sym.Declaration)
105-
panic("bad function")
105+
panic("bad function decl")
106106
}
107107
ft := &typing.FunctionType{
108108
Name: sym.Name,

0 commit comments

Comments
 (0)