[all-commits] [llvm/llvm-project] 398573: [lit] Make MetricValue a proper abstract base clas...

Prasoon via All-commits all-commits at lists.llvm.org
Fri May 29 09:10:31 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 398573eecb37143f649f0562e565a6a5f6da5255
      https://github.com/llvm/llvm-project/commit/398573eecb37143f649f0562e565a6a5f6da5255
  Author: Prasoon <prasoonkumar054 at gmail.com>
  Date:   2026-05-29 (Fri, 29 May 2026)

  Changed paths:
    M llvm/utils/lit/lit/Test.py

  Log Message:
  -----------
  [lit] Make MetricValue a proper abstract base class (#200187)

Currently, `MetricValue` signals abstract methods by raising
`RuntimeError("abstract method")` at runtime. This means a subclass that
forgets to implement `format()` or `todata()` is only caught when the
method is actually called.

This change makes `MetricValue` inherit from `abc.ABC` and decorates
`format` and `todata` with `@abc.abstractmethod`. All three existing
subclasses (`IntMetricValue`, `RealMetricValue`, `JSONMetricValue`)
already implement both methods. No change in behavior.

Signed-off-by: Prasoon Kumar <prasoonkumar054 at gmail.com>



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