================
@@ -146,13 +177,58 @@ lldb::TypeSP DWARFASTParserFortran::ParseTypeFromDWARF(
                         compiler_type, Type::ResolveState::Full);
     break;
   }
+  case DW_TAG_subprogram:
+  case DW_TAG_subroutine_type: {
+    CompilerType return_type;
+    dwarf->GetDIEToType()[die.GetDIE()] = DIE_IS_BEING_PARSED;
+    attributes = die.GetAttributes();
+    size_t num_attr = attributes.Size();
+
+    for (size_t i = 0; i < num_attr; ++i) {
+      if (!attributes.ExtractFormValueAtIndex(i, form_value))
+        continue;
+      switch (attributes.AttributeAtIndex(i)) {
+      case DW_AT_name:
+        type_name_cstr = form_value.AsCString();
+        if (type_name_cstr &&
+            type_name_cstr[0]) { // Check for null AND empty string
+          type_name.SetString(type_name_cstr);
+        } else {
+          type_name.SetCString("UNKNOWN_FORTRAN_FUNCTION");
+        }
+        break;
+
+      case DW_AT_type: {
+        if (DWARFDIE type_die = form_value.Reference())
+          if (Type *resolved_type = die.GetDWARF()->ResolveType(type_die))
+            return_type = resolved_type->GetForwardCompilerType();
+
+        break;
+      }
+
+      default:
+        break;
+      }
+    }
+
+    llvm::SmallVector<CompilerType, 4> function_params_types;
----------------
Iasonaskrpr wrote:

Yeah, it certainly is a bit long. I'll change it.

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

Reply via email to