llcppsigfetch:reuse clangutil

This commit is contained in:
luoliwoshang
2024-09-24 14:43:33 +08:00
parent 7b498065b5
commit 7aca31992b
4 changed files with 11 additions and 71 deletions

View File

@@ -8,11 +8,12 @@ import (
"github.com/goplus/llgo/c/cjson"
"github.com/goplus/llgo/c/clang"
"github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/clangutils"
)
func RunTest(testName string, testCases []string) {
for i, content := range testCases {
converter, err := parse.NewConverter(&parse.Config{
converter, err := parse.NewConverter(&clangutils.Config{
File: content,
Temp: true,
IsCpp: true,
@@ -63,7 +64,7 @@ type GetTypeOptions struct {
// e.g. index.Dispose(), unit.Dispose()
func GetType(option *GetTypeOptions) (clang.Type, *clang.Index, *clang.TranslationUnit) {
code := fmt.Sprintf("%s placeholder;", option.TypeCode)
index, unit, err := parse.CreateTranslationUnit(&parse.Config{
index, unit, err := clangutils.CreateTranslationUnit(&clangutils.Config{
File: code,
Temp: true,
Args: option.Args,