Index: lib/CodeGen/AsmPrinter/DwarfUnit.cpp =================================================================== --- lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -550,12 +550,15 @@ Encoding == dwarf::DW_ATE_unsigned_char || Encoding == dwarf::DW_ATE_signed || Encoding == dwarf::DW_ATE_signed_char || - Encoding == dwarf::DW_ATE_float || Encoding == dwarf::DW_ATE_UTF || - Encoding == dwarf::DW_ATE_boolean || + Encoding == dwarf::DW_ATE_float || + Encoding == dwarf::DW_ATE_complex_float || + Encoding == dwarf::DW_ATE_UTF || Encoding == dwarf::DW_ATE_boolean || (Ty->getTag() == dwarf::DW_TAG_unspecified_type && Ty->getName() == "decltype(nullptr)")) && "Unsupported encoding"); - return Encoding == dwarf::DW_ATE_unsigned || + return Encoding == dwarf::DW_ATE_float || + Encoding == dwarf::DW_ATE_complex_float || + Encoding == dwarf::DW_ATE_unsigned || Encoding == dwarf::DW_ATE_unsigned_char || Encoding == dwarf::DW_ATE_UTF || Encoding == dwarf::DW_ATE_boolean || Ty->getTag() == dwarf::DW_TAG_unspecified_type; Index: test/DebugInfo/ARM/sroa-complex.ll =================================================================== --- /dev/null +++ test/DebugInfo/ARM/sroa-complex.ll @@ -0,0 +1,52 @@ +; RUN: %llc_dwarf -O0 -filetype=obj -o %t.o %s +; RUN: llvm-dwarfdump -debug-dump=info %t.o | FileCheck %s +; REQUIRES: object-emission +target datalayout = "e-m:o-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" +target triple = "thumbv7-apple-unknown-macho" + +; generated from (-triple thumbv7-apple-unknown-macho -Os): +; void f(_Complex double c) { c = 0; } + +; Function Attrs: norecurse nounwind optsize readnone +define arm_aapcscc void @f([2 x i64] %c.coerce) #0 !dbg !4 { +entry: + ; The target has no native double type. + ; SROA split the complex value into two i64 values. + ; CHECK: DW_TAG_formal_parameter + ; CHECK-NEXT: DW_AT_const_value [DW_FORM_udata] (0) + tail call void @llvm.dbg.value(metadata i64 0, i64 0, metadata !10, metadata !18), !dbg !17 + ret void, !dbg !17 +} + +; Function Attrs: nounwind readnone +declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 + +; Function Attrs: nounwind readnone +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1 + +attributes #0 = { norecurse nounwind optsize readnone } +attributes #1 = { nounwind readnone } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!11, !12, !13, !14} +!llvm.ident = !{!15} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 259428)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) +!1 = !DIFile(filename: "", directory: "/Volumes/Data/radar/24456528") +!2 = !{} +!3 = !{!4} +!4 = distinct !DISubprogram(name: "f", scope: !5, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, variables: !9) +!5 = !DIFile(filename: "test.c", directory: "/Volumes/Data/radar/24456528") +!6 = !DISubroutineType(types: !7) +!7 = !{null, !8} +!8 = !DIBasicType(name: "complex", size: 128, align: 64, encoding: DW_ATE_complex_float) +!9 = !{!10} +!10 = !DILocalVariable(name: "c", arg: 1, scope: !4, file: !5, line: 1, type: !8) +!11 = !{i32 2, !"Dwarf Version", i32 4} +!12 = !{i32 2, !"Debug Info Version", i32 3} +!13 = !{i32 1, !"wchar_size", i32 4} +!14 = !{i32 1, !"min_enum_size", i32 4} +!15 = !{!"clang version 3.9.0 (trunk 259428)"} +!16 = !DIExpression() +!17 = !DILocation(line: 1, scope: !4) +!18 = !DIExpression(DW_OP_bit_piece, 0, 64) Index: test/DebugInfo/X86/float_const.ll =================================================================== --- test/DebugInfo/X86/float_const.ll +++ test/DebugInfo/X86/float_const.ll @@ -13,7 +13,7 @@ tail call void @llvm.dbg.declare(metadata float* undef, metadata !13, metadata !19), !dbg !20 tail call void @llvm.dbg.value(metadata i32 1078523331, i64 0, metadata !13, metadata !19), !dbg !20 tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !13, metadata !19), !dbg !20 -; CHECK: DW_AT_const_value [DW_FORM_sdata] (0) +; CHECK: DW_AT_const_value [DW_FORM_udata] (0) ; CHECK-NEXT: DW_AT_name {{.*}}"a" ret void, !dbg !21 }