cgo: run CGo parser for all CGo fragments in a file

Previously, libclang was run on each fragment (import "C") separately.
However, in regular Go it's possible for later fragments to refer to
types in earlier fragments so they must have been parsed as one.

This commit changes the behavior to run only one C parser invocation for
each Go file.
This commit is contained in:
Ayke van Laethem
2021-09-22 23:03:05 +02:00
committed by Ron Evans
parent 13891d428f
commit cceb655874
7 changed files with 156 additions and 162 deletions
+3
View File
@@ -19,6 +19,9 @@ typedef someType noType; // undefined type
// #define SOME_CONST_4 8) // after some empty lines
import "C"
// #warning another warning
import "C"
// Make sure that errors for the following lines won't change with future
// additions to the CGo preamble.
//line errors.go:100