[all-commits] [llvm/llvm-project] 566b72: [flang] Avoid exponential traversal in deep type e...

Sairudra More via All-commits all-commits at lists.llvm.org
Tue Apr 28 22:06:34 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 566b728a3b106ac4045258cfe6846e5941c5e7c5
      https://github.com/llvm/llvm-project/commit/566b728a3b106ac4045258cfe6846e5941c5e7c5
  Author: Sairudra More <sairudra60 at gmail.com>
  Date:   2026-04-29 (Wed, 29 Apr 2026)

  Changed paths:
    M flang/lib/Semantics/tools.cpp
    M flang/lib/Semantics/type.cpp
    A flang/test/Semantics/typesstress5.f90

  Log Message:
  -----------
  [flang] Avoid exponential traversal in deep type extensions (#191955)

`HasDestruction()` and `IsFinalizable()` walked component iterators that
already descend into parent scopes, and then also recursed through
derived-type components. With deep type extension chains, that caused
the same inheritance structure to be traversed repeatedly and compile
time to grow exponentially.

Iterate only over the current type scope instead. The scope contains the
type's own components plus its parent component, so the existing
recursion through derived-type components still handles inheritance
without double traversal.

Add a regression test with a deep type extension hierarchy.

Co-authored-by: Sairudra More <moresair at pe31.hpc.amslabs.hpecorp.net>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list