New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tripping llvm assert: Assertion `!isa<DIType>(Scope) && "shouldn't make a namespace scope for a type" #579

Closed
andrewrk opened this Issue Nov 2, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@andrewrk
Member

andrewrk commented Nov 2, 2017

In the llvm6 branch, this code triggers an llvm assertion failure (compiled against LLVM master branch).

const assert = @import("std").debug.assert;

const StructWithNoFields = struct {
    fn add(a: i32, b: i32) -> i32 { a + b }
};

export fn entry() {
    const result = StructWithNoFields.add(3, 4);
    assert(result == 7);
}

pub fn panic(msg: []const u8) -> noreturn { while (true) {} }

zig build-obj test.zig --target-os windows --target-arch x86_64 --target-environ msvc

zig: /home/andy/Downloads/llvm-project/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:271: llvm::codeview::TypeIndex llvm::CodeViewDebug::getScopeIndex(const llvm::DIScope*): Assertion `!isa<DIType>(Scope) && "shouldn't make a namespace scope for a type"' failed.

It generates this IR:

; ModuleID = 'test'
source_filename = "test"
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-windows-msvc"

%"[]u8" = type { i8*, i64 }

@assert.1 = internal unnamed_addr constant void (i1)* @assert, align 8
@is_test = internal unnamed_addr constant i1 false, align 1
@0 = internal unnamed_addr constant i8* getelementptr inbounds ([16 x i8], [16 x i8]* @1, i64 0, i64 0), align 8
@1 = internal unnamed_addr constant [16 x i8] c"integer overflow", align 1
@2 = internal unnamed_addr constant %"[]u8" { i8* getelementptr inbounds ([16 x i8], [16 x i8]* @1, i64 0, i64 0), i64 16 }, align 8
@3 = internal unnamed_addr constant i8* getelementptr inbounds ([24 x i8], [24 x i8]* @4, i64 0, i64 0), align 8
@4 = internal unnamed_addr constant [24 x i8] c"reached unreachable code", align 1
@5 = internal unnamed_addr constant %"[]u8" { i8* getelementptr inbounds ([24 x i8], [24 x i8]* @4, i64 0, i64 0), i64 24 }, align 8
@6 = internal unnamed_addr constant i8* getelementptr inbounds ([17 x i8], [17 x i8]* @7, i64 0, i64 0), align 8
@7 = internal unnamed_addr constant [17 x i8] c"assertion failure", align 1
@8 = internal unnamed_addr constant %"[]u8" { i8* getelementptr inbounds ([17 x i8], [17 x i8]* @7, i64 0, i64 0), i64 17 }, align 8

; Function Attrs: nobuiltin nounwind uwtable
define internal fastcc void @assert(i1) unnamed_addr #0 !dbg !9 {
Entry:
  %ok = alloca i1, align 1
  store i1 %0, i1* %ok, align 1
  call void @llvm.dbg.declare(metadata i1* %ok, metadata !15, metadata !DIExpression()), !dbg !16
  %1 = load i1, i1* %ok, align 1, !dbg !17
  %2 = icmp eq i1 %1, false, !dbg !20
  br i1 %2, label %Then, label %Else, !dbg !20

Then:                                             ; preds = %Entry
  call fastcc void @panic(%"[]u8"* @5), !dbg !21
  unreachable, !dbg !21

Else:                                             ; preds = %Entry
  br label %EndIf2, !dbg !24

Then1:                                            ; No predecessors!
  call fastcc void @panic(%"[]u8"* @8), !dbg !25
  unreachable, !dbg !25

EndIf:                                            ; No predecessors!
  br label %EndIf2, !dbg !24

EndIf2:                                           ; preds = %EndIf, %Else
  ret void, !dbg !27
}

; Function Attrs: nobuiltin noreturn nounwind uwtable
define internal fastcc void @panic(%"[]u8"* nonnull readonly) unnamed_addr #1 !dbg !28 {
Entry:
  call void @llvm.dbg.declare(metadata %"[]u8"* %0, metadata !41, metadata !DIExpression()), !dbg !42
  br label %WhileCond, !dbg !43

WhileCond:                                        ; preds = %WhileCond, %Entry
  br label %WhileCond, !dbg !43
}

; Function Attrs: nobuiltin nounwind uwtable
define void @entry() #0 !dbg !46 {
Entry:
  %result = alloca i32, align 4
  %0 = call fastcc i32 @StructWithNoFields_add(i32 3, i32 4), !dbg !53
  store i32 %0, i32* %result, align 4, !dbg !54
  call void @llvm.dbg.declare(metadata i32* %result, metadata !50, metadata !DIExpression()), !dbg !54
  %1 = load i32, i32* %result, align 4, !dbg !55
  %2 = icmp eq i32 %1, 7, !dbg !57
  call fastcc void @assert(i1 %2), !dbg !58
  ret void, !dbg !59
}

; Function Attrs: nobuiltin nounwind uwtable
define internal fastcc i32 @StructWithNoFields_add(i32, i32) unnamed_addr #0 !dbg !60 {
Entry:
  %a = alloca i32, align 4
  %b = alloca i32, align 4
  store i32 %0, i32* %a, align 4
  call void @llvm.dbg.declare(metadata i32* %a, metadata !64, metadata !DIExpression()), !dbg !67
  store i32 %1, i32* %b, align 4
  call void @llvm.dbg.declare(metadata i32* %b, metadata !65, metadata !DIExpression()), !dbg !68
  %2 = load i32, i32* %a, align 4, !dbg !69
  %3 = load i32, i32* %b, align 4, !dbg !72
  %4 = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %2, i32 %3), !dbg !73
  %5 = extractvalue { i32, i1 } %4, 0, !dbg !73
  %6 = extractvalue { i32, i1 } %4, 1, !dbg !73
  br i1 %6, label %OverflowFail, label %OverflowOk, !dbg !73

OverflowFail:                                     ; preds = %Entry
  call fastcc void @panic(%"[]u8"* @2), !dbg !73
  unreachable, !dbg !73

OverflowOk:                                       ; preds = %Entry
  ret i32 %5, !dbg !74
}

; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.declare(metadata, metadata, metadata) #2

; Function Attrs: nounwind readnone speculatable
declare { i32, i1 } @llvm.sadd.with.overflow.i32(i32, i32) #2

attributes #0 = { nobuiltin nounwind uwtable "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" }
attributes #1 = { nobuiltin noreturn nounwind uwtable "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" }
attributes #2 = { nounwind readnone speculatable }

!llvm.module.flags = !{!0}
!llvm.dbg.cu = !{!1}

!0 = !{i32 2, !"CodeView", i32 1}
!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "zig 0.1.1.ec464b1", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !3, globals: !4)
!2 = !DIFile(filename: "test", directory: ".")
!3 = !{}
!4 = !{!5}
!5 = !DIGlobalVariableExpression(var: !6, expr: !DIExpression())
!6 = distinct !DIGlobalVariable(name: "is_test", linkageName: "is_test", scope: !7, file: !7, line: 217, type: !8, isLocal: true, isDefinition: true)
!7 = !DIFile(filename: "builtin.zig", directory: "/home/andy/dev/zig/build/zig-cache")
!8 = !DIBasicType(name: "bool", size: 8, encoding: DW_ATE_boolean)
!9 = distinct !DISubprogram(name: "assert", scope: !10, file: !10, line: 15, type: !11, isLocal: true, isDefinition: true, scopeLine: 15, isOptimized: false, unit: !1, variables: !14)
!10 = !DIFile(filename: "debug.zig", directory: "/home/andy/dev/zig/build/lib/zig/std")
!11 = !DISubroutineType(types: !12)
!12 = !{!13, !8}
!13 = !DIBasicType(name: "void", encoding: DW_ATE_unsigned)
!14 = !{!15}
!15 = !DILocalVariable(name: "ok", arg: 1, scope: !9, file: !10, line: 15, type: !8)
!16 = !DILocation(line: 15, column: 15, scope: !9)
!17 = !DILocation(line: 16, column: 10, scope: !18)
!18 = distinct !DILexicalBlock(scope: !19, file: !10, line: 15, column: 25)
!19 = distinct !DILexicalBlock(scope: !9, file: !10, line: 15, column: 15)
!20 = !DILocation(line: 16, column: 9, scope: !18)
!21 = !DILocation(line: 22, column: 13, scope: !22)
!22 = distinct !DILexicalBlock(scope: !23, file: !10, line: 21, column: 16)
!23 = distinct !DILexicalBlock(scope: !18, file: !10, line: 16, column: 14)
!24 = !DILocation(line: 16, column: 5, scope: !18)
!25 = !DILocation(line: 20, column: 13, scope: !26)
!26 = distinct !DILexicalBlock(scope: !23, file: !10, line: 19, column: 30)
!27 = !DILocation(line: 16, column: 5, scope: !19)
!28 = distinct !DISubprogram(name: "panic", scope: !29, file: !29, line: 12, type: !30, isLocal: true, isDefinition: true, scopeLine: 12, isOptimized: false, unit: !1, variables: !40)
!29 = !DIFile(filename: "test.zig", directory: "/home/andy/dev/zig/build")
!30 = !DISubroutineType(types: !31)
!31 = !{!13, !32}
!32 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "&[]const u8", baseType: !33, size: 64, align: 64)
!33 = !DICompositeType(tag: DW_TAG_structure_type, name: "[]u8", size: 128, align: 64, elements: !34)
!34 = !{!35, !38}
!35 = !DIDerivedType(tag: DW_TAG_member, name: "ptr", scope: !33, baseType: !36, size: 64, align: 64)
!36 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "&u8", baseType: !37, size: 64, align: 64)
!37 = !DIBasicType(name: "u8", size: 8, encoding: DW_ATE_unsigned_char)
!38 = !DIDerivedType(tag: DW_TAG_member, name: "len", scope: !33, baseType: !39, size: 64, align: 64, offset: 64)
!39 = !DIBasicType(name: "usize", size: 64, encoding: DW_ATE_unsigned)
!40 = !{!41}
!41 = !DILocalVariable(name: "msg", arg: 1, scope: !28, file: !29, line: 12, type: !33)
!42 = !DILocation(line: 12, column: 14, scope: !28)
!43 = !DILocation(line: 12, column: 45, scope: !44)
!44 = distinct !DILexicalBlock(scope: !45, file: !29, line: 12, column: 43)
!45 = distinct !DILexicalBlock(scope: !28, file: !29, line: 12, column: 14)
!46 = distinct !DISubprogram(name: "entry", scope: !29, file: !29, line: 7, type: !47, isLocal: false, isDefinition: true, scopeLine: 7, isOptimized: false, unit: !1, variables: !49)
!47 = !DISubroutineType(types: !48)
!48 = !{!13}
!49 = !{!50}
!50 = !DILocalVariable(name: "result", scope: !51, file: !29, line: 8, type: !52)
!51 = distinct !DILexicalBlock(scope: !46, file: !29, line: 7, column: 19)
!52 = !DIBasicType(name: "i32", size: 32, encoding: DW_ATE_signed)
!53 = !DILocation(line: 8, column: 42, scope: !51)
!54 = !DILocation(line: 8, column: 5, scope: !51)
!55 = !DILocation(line: 9, column: 12, scope: !56)
!56 = distinct !DILexicalBlock(scope: !51, file: !29, line: 8, column: 5)
!57 = !DILocation(line: 9, column: 19, scope: !56)
!58 = !DILocation(line: 9, column: 11, scope: !56)
!59 = !DILocation(line: 7, column: 19, scope: !46)
!60 = distinct !DISubprogram(name: "StructWithNoFields_add", scope: !13, file: !29, line: 4, type: !61, isLocal: true, isDefinition: true, scopeLine: 4, isOptimized: false, unit: !1, variables: !63)
!61 = !DISubroutineType(types: !62)
!62 = !{!52, !52, !52}
!63 = !{!64, !65}
!64 = !DILocalVariable(name: "a", arg: 1, scope: !60, file: !29, line: 4, type: !52)
!65 = !DILocalVariable(name: "b", arg: 2, scope: !66, file: !29, line: 4, type: !52)
!66 = distinct !DILexicalBlock(scope: !60, file: !29, line: 4, column: 12)
!67 = !DILocation(line: 4, column: 12, scope: !60)
!68 = !DILocation(line: 4, column: 20, scope: !66)
!69 = !DILocation(line: 4, column: 37, scope: !70)
!70 = distinct !DILexicalBlock(scope: !71, file: !29, line: 4, column: 35)
!71 = distinct !DILexicalBlock(scope: !66, file: !29, line: 4, column: 20)
!72 = !DILocation(line: 4, column: 41, scope: !70)
!73 = !DILocation(line: 4, column: 39, scope: !70)
!74 = !DILocation(line: 4, column: 39, scope: !71)

It looks like the problem is:

!13 = !DIBasicType(name: "void", encoding: DW_ATE_unsigned)
!60 = distinct !DISubprogram(name: "StructWithNoFields_add", scope: !13, file: !29, line: 4, type: !61, isLocal: true, isDefinition: true, scopeLine: 4, isOptimized: false, unit: !1, variables: !63)

We generate StructWithNoFields as !DIBasicType(name: "void", encoding: DW_ATE_unsigned) and then try to use it as a scope.

Here's how clang handles this situation in C++:

#include <inttypes.h>
#include <assert.h>

struct StructWithNoFields {
    static uint32_t add(uint32_t a, uint32_t b) { return a + b; }
};

int main(int argc, char **argv) {
    uint32_t result = StructWithNoFields::add(3, 4);
    assert(result == 7);
    return 0;
}

clang++ -emit-llvm -S test.cpp -target windows-x86_64 -g -gcodeview

; ModuleID = 'test.cpp'
source_filename = "test.cpp"
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64--windows-msvc18.0.0"

$"\01?add@StructWithNoFields@@SAIII@Z" = comdat any

$"\01??_C@_08ENCNIKBI@test?4cpp?$AA@" = comdat any

$"\01??_C@_0M@KBOHFKOF@result?5?$DN?$DN?57?$AA@" = comdat any

@"\01??_C@_08ENCNIKBI@test?4cpp?$AA@" = linkonce_odr unnamed_addr constant [9 x i8] c"test.cpp\00", comdat, align 1
@"\01??_C@_0M@KBOHFKOF@result?5?$DN?$DN?57?$AA@" = linkonce_odr unnamed_addr constant [12 x i8] c"result == 7\00", comdat, align 1

; Function Attrs: noinline norecurse optnone uwtable
define i32 @main(i32, i8**) #0 !dbg !13 {
  %3 = alloca i32, align 4
  %4 = alloca i8**, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store i32 0, i32* %3, align 4
  store i8** %1, i8*** %4, align 8
  call void @llvm.dbg.declare(metadata i8*** %4, metadata !19, metadata !20), !dbg !21
  store i32 %0, i32* %5, align 4
  call void @llvm.dbg.declare(metadata i32* %5, metadata !22, metadata !20), !dbg !23
  call void @llvm.dbg.declare(metadata i32* %6, metadata !24, metadata !20), !dbg !28
  %7 = call i32 @"\01?add@StructWithNoFields@@SAIII@Z"(i32 3, i32 4), !dbg !29
  store i32 %7, i32* %6, align 4, !dbg !28
  %8 = load i32, i32* %6, align 4, !dbg !30
  %9 = icmp eq i32 %8, 7, !dbg !30
  br i1 %9, label %10, label %11, !dbg !30

; <label>:10:                                     ; preds = %2
  br label %12, !dbg !30

; <label>:11:                                     ; preds = %2
  call void @__assert_fail(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @"\01??_C@_0M@KBOHFKOF@result?5?$DN?$DN?57?$AA@", i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @"\01??_C@_08ENCNIKBI@test?4cpp?$AA@", i32 0, i32 0), i32 10, i8* null), !dbg !30
  br label %12, !dbg !30

; <label>:12:                                     ; preds = %11, %10
  ret i32 0, !dbg !31
}

; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1

; Function Attrs: noinline nounwind optnone uwtable
define linkonce_odr i32 @"\01?add@StructWithNoFields@@SAIII@Z"(i32, i32) #2 comdat align 2 !dbg !32 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store i32 %1, i32* %3, align 4
  call void @llvm.dbg.declare(metadata i32* %3, metadata !38, metadata !20), !dbg !39
  store i32 %0, i32* %4, align 4
  call void @llvm.dbg.declare(metadata i32* %4, metadata !40, metadata !20), !dbg !41
  %5 = load i32, i32* %4, align 4, !dbg !42
  %6 = load i32, i32* %3, align 4, !dbg !43
  %7 = add i32 %5, %6, !dbg !44
  ret i32 %7, !dbg !45
}

declare void @__assert_fail(i8*, i8*, i32, i8*) #3

attributes #0 = { noinline norecurse optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone speculatable }
attributes #2 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #3 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!8, !9, !10, !11}
!llvm.ident = !{!12}

!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (tags/RELEASE_500/final)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3)
!1 = !DIFile(filename: "test.cpp", directory: "/home/andy/tmp", checksumkind: CSK_MD5, checksum: "2998daae40ef6b7c369843b8f6254d1e")
!2 = !{}
!3 = !{!4, !5}
!4 = !DIBasicType(name: "bool", size: 8, encoding: DW_ATE_boolean)
!5 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64)
!6 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !7)
!7 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
!8 = !{i32 2, !"CodeView", i32 1}
!9 = !{i32 2, !"Debug Info Version", i32 3}
!10 = !{i32 1, !"wchar_size", i32 2}
!11 = !{i32 7, !"PIC Level", i32 2}
!12 = !{!"clang version 5.0.0 (tags/RELEASE_500/final)"}
!13 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 8, type: !14, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!14 = !DISubroutineType(types: !15)
!15 = !{!16, !16, !17}
!16 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !18, size: 64)
!18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64)
!19 = !DILocalVariable(name: "argv", arg: 2, scope: !13, file: !1, line: 8, type: !17)
!20 = !DIExpression()
!21 = !DILocation(line: 8, column: 27, scope: !13)
!22 = !DILocalVariable(name: "argc", arg: 1, scope: !13, file: !1, line: 8, type: !16)
!23 = !DILocation(line: 8, column: 14, scope: !13)
!24 = !DILocalVariable(name: "result", scope: !13, file: !1, line: 9, type: !25)
!25 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint32_t", file: !26, line: 53, baseType: !27)
!26 = !DIFile(filename: "/nix/store/qxb0x9fcs60zv719yy0zm95gyd8mmgks-glibc-2.25-49-dev/include/stdint.h", directory: "/home/andy/tmp", checksumkind: CSK_MD5, checksum: "d90028774363ef7ad3dbde9aeb1ed2b1")
!27 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
!28 = !DILocation(line: 9, column: 14, scope: !13)
!29 = !DILocation(line: 9, column: 23, scope: !13)
!30 = !DILocation(line: 10, column: 5, scope: !13)
!31 = !DILocation(line: 11, column: 5, scope: !13)
!32 = distinct !DISubprogram(name: "add", linkageName: "\01?add@StructWithNoFields@@SAIII@Z", scope: !33, file: !1, line: 5, type: !36, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !35, variables: !2)
!33 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "StructWithNoFields", file: !1, line: 4, size: 8, elements: !34, identifier: ".?AUStructWithNoFields@@")
!34 = !{!35}
!35 = !DISubprogram(name: "add", linkageName: "\01?add@StructWithNoFields@@SAIII@Z", scope: !33, file: !1, line: 5, type: !36, isLocal: false, isDefinition: false, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false)
!36 = !DISubroutineType(types: !37)
!37 = !{!25, !25, !25}
!38 = !DILocalVariable(name: "b", arg: 2, scope: !32, file: !1, line: 5, type: !25)
!39 = !DILocation(line: 5, column: 46, scope: !32)
!40 = !DILocalVariable(name: "a", arg: 1, scope: !32, file: !1, line: 5, type: !25)
!41 = !DILocation(line: 5, column: 34, scope: !32)
!42 = !DILocation(line: 5, column: 58, scope: !32)
!43 = !DILocation(line: 5, column: 62, scope: !32)
!44 = !DILocation(line: 5, column: 60, scope: !32)
!45 = !DILocation(line: 5, column: 51, scope: !32)

It emits StructWithNoFields and the add function like this:

!32 = distinct !DISubprogram(name: "add", linkageName: "\01?add@StructWithNoFields@@SAIII@Z", scope: !33, file: !1, line: 5, type: !36, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !35, variables: !2)
!33 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "StructWithNoFields", file: !1, line: 4, size: 8, elements: !34, identifier: ".?AUStructWithNoFields@@")

If we do the same in Zig it should fix this assertion error.

@andrewrk andrewrk added the bug label Nov 2, 2017

@andrewrk andrewrk added this to the 0.2.0 milestone Nov 2, 2017

@andrewrk andrewrk closed this in dc8b011 Nov 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment