[all-commits] [llvm/llvm-project] ffaca1: [IR] Value: Fix OpCode checks

Sami Tolvanen via All-commits all-commits at lists.llvm.org
Thu Jun 10 16:46:53 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ffaca140d01b0b93723c3322b08351b03b95831f
      https://github.com/llvm/llvm-project/commit/ffaca140d01b0b93723c3322b08351b03b95831f
  Author: Sami Tolvanen <samitolvanen at google.com>
  Date:   2021-06-10 (Thu, 10 Jun 2021)

  Changed paths:
    M llvm/lib/IR/Value.cpp

  Log Message:
  -----------
  [IR] Value: Fix OpCode checks

Value::SubclassID cannot be directly compared to Instruction enums, such as
Instruction::{Call,Invoke,CallBr}. We have to first subtract InstructionVal
from the SubclassID to get the OpCode, similar to Instruction::getOpCode().

Reviewed By: nickdesaulniers

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




More information about the All-commits mailing list