[PATCH] D134488: [llvm] Assert two ValIDs are the same kind before comparing

Leonard Chan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 22 15:19:15 PDT 2022


leonardchan added a comment.

Locally I can assert none of the current llvm tests fail with this in a debug build.

Alternative approaches are just adding another branch that compares the kinds:

  bool operator<(const ValID &RHS) const {
    if (Kind != RHS.Kind) return Kind < RHS.Kind;
  ...

or updating the ValID layout to hide members behind getters/setters that assert the correct kind.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134488/new/

https://reviews.llvm.org/D134488



More information about the llvm-commits mailing list