[PATCH] D137164: [LLParser] Handle mixed blockaddress forward references with names and IDs

Michiel Derhaeg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 12:55:34 PST 2022


MichielDerhaeg added a comment.

In D137164#3915823 <https://reviews.llvm.org/D137164#3915823>, @dexonsmith wrote:

> Would it be simpler to define `<` for that case? Or, we could define a custom one to send to the `std::map`:
>
>   struct CompareValID {
>     static bool operator<(const ValID &LHS, const ValID &RHS) {
>       if (LHS.Kind != RHS.Kind)
>         return LHS.Kind < RHS.Kind;
>       return LHS < RHS;
>     }
>   };

That was my initial idea, but if you search for other ForwardRef-related datastructures in LLParser.cpp, you'll see that they solved it this way for all other cases as well.
I did it like this to remain consistent.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137164



More information about the llvm-commits mailing list