From e6d3c58b6376acb69cbb7164a11e7b95f5a4fc52 Mon Sep 17 00:00:00 2001 From: Rainer Date: Mon, 16 Dec 2024 21:01:14 +0100 Subject: [PATCH] add debug info for function parameter types --- gen/dibuilder.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gen/dibuilder.cpp b/gen/dibuilder.cpp index 1ae5658960..80bb825bf9 100644 --- a/gen/dibuilder.cpp +++ b/gen/dibuilder.cpp @@ -725,11 +725,12 @@ DISubroutineType DIBuilder::CreateFunctionType(Type *type) { assert(t); Type *retType = t->next; - - // Create "dummy" subroutine type for the return type - LLMetadata *params = {CreateTypeDescription(retType)}; + llvm::SmallVector params; + params.emplace_back(CreateTypeDescription(retType)); + if (auto parameters = t->parameterList.parameters) + for (auto &p : *parameters) + params.emplace_back(CreateTypeDescription(p->type)); auto paramsArray = DBuilder.getOrCreateTypeArray(params); - return DBuilder.createSubroutineType(paramsArray, DIFlags::FlagZero, 0); } @@ -809,6 +810,8 @@ DIType DIBuilder::CreateTypeDescription(Type *t, bool voidToUbyte) { return CreateFunctionType(tf); if (auto td = t->isTypeDelegate()) return CreateDelegateType(td); + if (auto tt = t->isTypeTuple()) + return DBuilder.createUnspecifiedType(processDIName("tuple")); // TODO // Crash if the type is not supported. llvm_unreachable("Unsupported type in debug info");