[all-commits] [llvm/llvm-project] d196f9: [InstructionCost] Prevent InstructionCost being cr...

sdesmalen-arm via All-commits all-commits at lists.llvm.org
Mon Jan 25 03:27:58 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d196f9e2fca3ff767aa7d2dcaf4654724a79e18c
      https://github.com/llvm/llvm-project/commit/d196f9e2fca3ff767aa7d2dcaf4654724a79e18c
  Author: Sander de Smalen <sander.desmalen at arm.com>
  Date:   2021-01-25 (Mon, 25 Jan 2021)

  Changed paths:
    M llvm/include/llvm/Support/InstructionCost.h

  Log Message:
  -----------
  [InstructionCost] Prevent InstructionCost being created with CostState.

For a function that returns InstructionCost, it is very tempting to write:

  return InstructionCost::Invalid;

But that actually returns InstructionCost(1 /* int value of Invalid */))
which has a totally different meaning. By marking this constructor as
`delete`, this can no longer happen.




More information about the All-commits mailing list