================
@@ -63,6 +63,37 @@ TypeSP
DWARFASTParserFortran::UpdateSymbolContextScopeForType(
return type_sp;
}
+void DWARFASTParserFortran::ParseChildParameters(
+ const DWARFDIE &parent_die,
+ llvm::SmallVectorImpl<CompilerType> &function_param_types,
+ llvm::SmallVectorImpl<llvm::StringRef> &function_param_names) {
+ if (!parent_die)
+ return;
+
+ for (DWARFDIE die : parent_die.children()) {
+ const dw_tag_t tag = die.Tag();
+ switch (tag) {
+ case DW_TAG_formal_parameter: {
+ if (die.GetAttributeValueAsUnsigned(DW_AT_artificial, 0))
+ continue;
+
+ DWARFDIE param_type_die =
die.GetAttributeValueAsReferenceDIE(DW_AT_type);
+
+ Type *type = die.ResolveTypeUID(param_type_die);
+ if (!type)
+ break;
+
+ function_param_names.emplace_back(die.GetName());
+ function_param_types.push_back(type->GetForwardCompilerType());
+ } break;
+ default:
+ break;
+ }
+ }
+
+ assert(function_param_names.size() == function_param_types.size());
----------------
DavidSpickett wrote:
In theory we should not crash on malformed DWARF, and it was asked about on the
other PR in this stack what happens if the two are mismatched.
Do you know if the C/C++ side does any better of a job here?
One way is to clear all the vectors and return. With a log message if we're
able to do that here.
https://github.com/llvm/llvm-project/pull/234312
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits