[PATCH] D88832: [TableGen] Add new getAllDerivedDefinitionsTwo function to RecordKeeper

Madhur Amilkanthwar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 5 06:49:02 PDT 2020


madhur13490 added inline comments.


================
Comment at: llvm/include/llvm/TableGen/Record.h:1793
+  /// classes. The classes must be defined.
+  std::vector<Record *> getAllDerivedDefinitionsTwo(StringRef ClassName1,
+                                                    StringRef ClassName2) const;
----------------
madhur13490 wrote:
> Can we please name it as `getAllCommonDerivedDefinitions`? I feel this more scalable, readable and intuitive. Suffixing "Two" is not scalable. If we have the word "common" in the name then we can overload this function for more than two parents in future to obtain common records. Also this function can take array and be more general.
In fact, if you want to generalize it then you should be able to use std::set because you're doing intersection here, anyway.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88832



More information about the llvm-commits mailing list