[all-commits] [llvm/llvm-project] a678c6: IR: Fix const-correctness of SwitchInst::CaseItera...

Duncan P. N. Exon Smith via All-commits all-commits at lists.llvm.org
Fri Nov 12 14:17:03 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a678c6743f536dac67b3714fd8c71dca7b1ae082
      https://github.com/llvm/llvm-project/commit/a678c6743f536dac67b3714fd8c71dca7b1ae082
  Author: Duncan P. N. Exon Smith <dexonsmith at apple.com>
  Date:   2021-11-12 (Fri, 12 Nov 2021)

  Changed paths:
    M llvm/include/llvm/IR/Instructions.h

  Log Message:
  -----------
  IR: Fix const-correctness of SwitchInst::CaseIterator and CaseHandle

Fix some confusion between the two types of `const` a pointer/iterator
can have. Users of a SwitchInst::CaseIterator should not (and do not!)
manually mutate the SwitchInst::CaseHandle that tracks its internal
state. Change operator*() to return `const CaseHandle&`, remove the
non-const-qualified operator*(), and const-qualify
CaseHandle::setValue() and CaseHandle::setSuccessor().

Differential Revision: https://reviews.llvm.org/D113788




More information about the All-commits mailing list