@@ -207,6 +207,7 @@ func (p *SymbolProcessor) userEditGoName(manglingName string) (goName string, is
207207func (p * SymbolProcessor ) genGoName (cursor clang.Cursor , mangleName string ) string {
208208
209209 edittedGoName , isEdittedGoName , isEdittedMethodName := p .userEditGoName (mangleName )
210+
210211 if dbg .GetDebugEditSymMap () && isEdittedGoName {
211212 fmt .Println ("edittedGoName:" , edittedGoName )
212213 fmt .Println ("isEdittedGoName" , isEdittedGoName )
@@ -295,16 +296,22 @@ func (p *SymbolProcessor) collectFuncInfo(cursor clang.Cursor) {
295296 return
296297 }
297298
299+ // ignore
300+ goName := p .genGoName (cursor , manglingName )
301+ if goName == "-" || len (goName ) == 0 {
302+ return
303+ }
304+
298305 p .SymbolMap [manglingName ] = & SymbolInfo {
299- GoName : p . genGoName ( cursor , manglingName ) ,
306+ GoName : goName ,
300307 ProtoName : p .genProtoName (cursor ),
301308 }
302309}
303310
304311func (p * SymbolProcessor ) visitTop (cursor , parent clang.Cursor ) clang.ChildVisitResult {
305312 filename := clang .GoString (cursor .Location ().File ().FileName ())
306313 if _ , ok := p .processedFiles [filename ]; ok {
307- if dbg .GetDebugSymbol ( ) {
314+ if dbg .GetDebugVisitTop () && p . isSelfFile ( filename ) {
308315 fmt .Printf ("visitTop: %s has been processed: \n " , filename )
309316 }
310317 return clang .ChildVisit_Continue
@@ -313,7 +320,7 @@ func (p *SymbolProcessor) visitTop(cursor, parent clang.Cursor) clang.ChildVisit
313320 return clang .ChildVisit_Continue
314321 }
315322 p .processingFiles [filename ] = struct {}{}
316- if dbg .GetDebugSymbol () && filename != "" {
323+ if dbg .GetDebugVisitTop () && p . isSelfFile ( filename ) {
317324 fmt .Printf ("visitTop: %s\n " , filename )
318325 }
319326 switch cursor .Kind {
@@ -334,20 +341,20 @@ func (p *SymbolProcessor) collect(cfg *clangutils.Config) error {
334341 filename = clangutils .TEMP_FILE
335342 }
336343 if _ , ok := p .processedFiles [filename ]; ok {
337- if dbg .GetDebugSymbol () {
344+ if dbg .GetDebugSymbol () && p . isSelfFile ( filename ) {
338345 fmt .Printf ("%s has been processed: \n " , filename )
339346 }
340347 return nil
341348 }
342- if dbg .GetDebugSymbol () {
349+ if dbg .GetDebugSymbol () && p . isSelfFile ( filename ) {
343350 fmt .Printf ("create translation unit: \n file:%s\n IsCpp:%v\n Temp:%v\n Args:%v\n " , filename , cfg .IsCpp , cfg .Temp , cfg .Args )
344351 }
345352 _ , unit , err := clangutils .CreateTranslationUnit (cfg )
346353 if err != nil {
347354 return errors .New ("Unable to parse translation unit for file " + filename )
348355 }
349356 cursor := unit .Cursor ()
350- if dbg .GetDebugSymbol ( ) {
357+ if dbg .GetDebugVisitTop () && p . isSelfFile ( filename ) {
351358 fmt .Printf ("%s start collect \n " , filename )
352359 }
353360 clangutils .VisitChildren (cursor , p .visitTop )
0 commit comments