| ... | @@ -3741,7 +3741,12 @@ fn transType(c: *Context, scope: *Scope, ty: *const clang.Type, source_loc: clan | ... | @@ -3741,7 +3741,12 @@ fn transType(c: *Context, scope: *Scope, ty: *const clang.Type, source_loc: clan |
| 3741 | const typedef_ty = @ptrCast(*const clang.TypedefType, ty); | 3741 | const typedef_ty = @ptrCast(*const clang.TypedefType, ty); |
| 3742 | | 3742 | |
| 3743 | const typedef_decl = typedef_ty.getDecl(); | 3743 | const typedef_decl = typedef_ty.getDecl(); |
| 3744 | try transTypeDef(c, scope, typedef_decl); | 3744 | var trans_scope = scope; |
| | 3745 | if (@ptrCast(*const clang.Decl, typedef_decl).castToNamedDecl()) |named_decl| { |
| | 3746 | const decl_name = try c.str(named_decl.getName_bytes_begin()); |
| | 3747 | if (c.global_names.get(decl_name)) |_| trans_scope = &c.global_scope.base; |
| | 3748 | } |
| | 3749 | try transTypeDef(c, trans_scope, typedef_decl); |
| 3745 | const name = c.decl_table.get(@ptrToInt(typedef_decl.getCanonicalDecl())).?; | 3750 | const name = c.decl_table.get(@ptrToInt(typedef_decl.getCanonicalDecl())).?; |
| 3746 | return Tag.identifier.create(c.arena, name); | 3751 | return Tag.identifier.create(c.arena, name); |
| 3747 | }, | 3752 | }, |
| ... | @@ -3749,7 +3754,12 @@ fn transType(c: *Context, scope: *Scope, ty: *const clang.Type, source_loc: clan | ... | @@ -3749,7 +3754,12 @@ fn transType(c: *Context, scope: *Scope, ty: *const clang.Type, source_loc: clan |
| 3749 | const record_ty = @ptrCast(*const clang.RecordType, ty); | 3754 | const record_ty = @ptrCast(*const clang.RecordType, ty); |
| 3750 | | 3755 | |
| 3751 | const record_decl = record_ty.getDecl(); | 3756 | const record_decl = record_ty.getDecl(); |
| 3752 | try transRecordDecl(c, scope, record_decl); | 3757 | var trans_scope = scope; |
| | 3758 | if (@ptrCast(*const clang.Decl, record_decl).castToNamedDecl()) |named_decl| { |
| | 3759 | const decl_name = try c.str(named_decl.getName_bytes_begin()); |
| | 3760 | if (c.global_names.get(decl_name)) |_| trans_scope = &c.global_scope.base; |
| | 3761 | } |
| | 3762 | try transRecordDecl(c, trans_scope, record_decl); |
| 3753 | const name = c.decl_table.get(@ptrToInt(record_decl.getCanonicalDecl())).?; | 3763 | const name = c.decl_table.get(@ptrToInt(record_decl.getCanonicalDecl())).?; |
| 3754 | return Tag.identifier.create(c.arena, name); | 3764 | return Tag.identifier.create(c.arena, name); |
| 3755 | }, | 3765 | }, |
| ... | @@ -3757,7 +3767,12 @@ fn transType(c: *Context, scope: *Scope, ty: *const clang.Type, source_loc: clan | ... | @@ -3757,7 +3767,12 @@ fn transType(c: *Context, scope: *Scope, ty: *const clang.Type, source_loc: clan |
| 3757 | const enum_ty = @ptrCast(*const clang.EnumType, ty); | 3767 | const enum_ty = @ptrCast(*const clang.EnumType, ty); |
| 3758 | | 3768 | |
| 3759 | const enum_decl = enum_ty.getDecl(); | 3769 | const enum_decl = enum_ty.getDecl(); |
| 3760 | try transEnumDecl(c, scope, enum_decl); | 3770 | var trans_scope = scope; |
| | 3771 | if (@ptrCast(*const clang.Decl, enum_decl).castToNamedDecl()) |named_decl| { |
| | 3772 | const decl_name = try c.str(named_decl.getName_bytes_begin()); |
| | 3773 | if (c.global_names.get(decl_name)) |_| trans_scope = &c.global_scope.base; |
| | 3774 | } |
| | 3775 | try transEnumDecl(c, trans_scope, enum_decl); |
| 3761 | const name = c.decl_table.get(@ptrToInt(enum_decl.getCanonicalDecl())).?; | 3776 | const name = c.decl_table.get(@ptrToInt(enum_decl.getCanonicalDecl())).?; |
| 3762 | return Tag.identifier.create(c.arena, name); | 3777 | return Tag.identifier.create(c.arena, name); |
| 3763 | }, | 3778 | }, |