diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-08-13 15:54:46 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-08-13 20:32:32 -0700 |
| commit | 576581bd7b78825ce27d6a73fc42dd90eab8fbd1 (patch) | |
| tree | a3c0f0d60d982d73c206bd172bddf2cdb69806fd /src | |
| parent | fc402bdbbbb5be2a538f0469f3f213264e7fcc59 (diff) | |
| download | zig-576581bd7b78825ce27d6a73fc42dd90eab8fbd1.tar.gz zig-576581bd7b78825ce27d6a73fc42dd90eab8fbd1.zip | |
stage1: fix enums having wrong debug info
It wasn't wrong info, but e.g. GDB couldn't handle non-power-of-two
enum tags. Now we tell debug info that enum tags are always power of two
size.
closes #4526
closes #5432
Diffstat (limited to 'src')
| -rw-r--r-- | src/analyze.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index e3e57ee34d..6a4a2ec052 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -8623,7 +8623,7 @@ static void resolve_llvm_types_enum(CodeGen *g, ZigType *enum_type, ResolveStatu enum_type->llvm_type = get_llvm_type(g, tag_int_type); // create debug type for tag - uint64_t tag_debug_size_in_bits = tag_int_type->size_in_bits; + uint64_t tag_debug_size_in_bits = 8*tag_int_type->abi_size; uint64_t tag_debug_align_in_bits = 8*tag_int_type->abi_align; ZigLLVMDIType *tag_di_type = ZigLLVMCreateDebugEnumerationType(g->dbuilder, ZigLLVMFileToScope(import->data.structure.root_struct->di_file), buf_ptr(&enum_type->name), |
