def record_legacy(self, name):
        """Record new timings and append to this collection.

        Note: this is mainly for internal use inside the compiler pipeline.

        See also ``RecordLLVMPassTimingsLegacy``

        Parameters
        ----------
        name: str
            Name for the records.
        """
        if config.LLVM_PASS_TIMINGS:
            # Recording of pass timings is enabled
            with RecordLLVMPassTimingsLegacy() as timings:
                yield
            rec = timings.get()
            # Only keep non-empty records
            if rec:
                self._append(name, rec)
        else:
            # Do nothing. Recording of pass timings is disabled.
            yield
Record new timings and append to this collection.

        Note: this is mainly for internal use inside the compiler pipeline.

        See also ``RecordLLVMPassTimingsLegacy``

        Parameters
        ----------
        name: str
            Name for the records.
        
numba/misc/llvm_pass_timings.py