[llvm] [TableGen] Refactor Intrinsics record (PR #106986)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 03:49:55 PDT 2024


================
@@ -273,11 +273,12 @@ using TypeSigTy = SmallVector<unsigned char>;
 /// Computes type signature of the intrinsic \p Int.
 static TypeSigTy ComputeTypeSignature(const CodeGenIntrinsic &Int) {
   TypeSigTy TypeSig;
-  if (const auto *R = Int.TheDef->getValue("TypeSig")) {
-    for (const auto *a : cast<ListInit>(R->getValue())->getValues()) {
-      for (const auto *b : cast<ListInit>(a)->getValues())
-        TypeSig.emplace_back(cast<IntInit>(b)->getValue());
-    }
+  const Record *TypeInfo = Int.TheDef->getValueAsDef("TypeInfo");
+  const ListInit *OuterList = TypeInfo->getValueAsListInit("TypeSig");
----------------
arsenm wrote:

This is dropping the null check that was here before

https://github.com/llvm/llvm-project/pull/106986


More information about the llvm-commits mailing list