Skip to content

Commit 06c1546

Browse files
committed
DebugInfo: Rebuild varargs function types correctly
Improves llvm-dwarfdump output and for simplified template names roundtripping.
1 parent 2c384c3 commit 06c1546

File tree

3 files changed

+372
-334
lines changed

3 files changed

+372
-334
lines changed

cross-project-tests/debuginfo-tests/clang_llvm_roundtrip/simplified_template_names.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ int main() {
217217
f1<decltype(L)>();
218218
t3<decltype(L)> v1;
219219
f1<int(float)>();
220+
f1<void(...)>();
221+
f1<void(int, ...)>();
220222
f1<const int &>();
221223
f1<const int *&>();
222224
f1<t5>();

llvm/lib/DebugInfo/DWARF/DWARFDie.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,8 @@ struct DWARFTypePrinter {
611611
bool First = true;
612612
bool RealFirst = true;
613613
for (DWARFDie P : D) {
614-
if (P.getTag() != DW_TAG_formal_parameter)
614+
if (P.getTag() != DW_TAG_formal_parameter &&
615+
P.getTag() != DW_TAG_unspecified_parameters)
615616
return;
616617
DWARFDie T = resolveReferencedType(P);
617618
if (SkipFirstParamIfArtificial && RealFirst && P.find(DW_AT_artificial)) {
@@ -623,7 +624,10 @@ struct DWARFTypePrinter {
623624
OS << ", ";
624625
}
625626
First = false;
626-
appendQualifiedName(T);
627+
if (P.getTag() == DW_TAG_unspecified_parameters)
628+
OS << "...";
629+
else
630+
appendQualifiedName(T);
627631
}
628632
EndedWithTemplate = false;
629633
OS << ')';

0 commit comments

Comments
 (0)