[llvm] [TableGen] Refactor Intrinsics record (PR #106986)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 4 07:07:17 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:
It's better to not rely on properties that happen to hold in the predefined .td files
https://github.com/llvm/llvm-project/pull/106986
More information about the llvm-commits
mailing list