[PATCH] D122140: [X86][NFC] MnemonicTables: only access RI fields if they're initialized

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 21 09:25:48 PDT 2022


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG442e9e1389b5: [X86][NFC] MnemonicTables: only access RI fields if they're initialized (authored by Amir).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122140

Files:
  llvm/utils/TableGen/X86MnemonicTables.cpp


Index: llvm/utils/TableGen/X86MnemonicTables.cpp
===================================================================
--- llvm/utils/TableGen/X86MnemonicTables.cpp
+++ llvm/utils/TableGen/X86MnemonicTables.cpp
@@ -49,18 +49,15 @@
     const CodeGenInstruction *I = NumberedInstructions[II];
     X86Disassembler::RecognizableInstr RI(Tables, *I, II);
     Record *Def = I->TheDef;
-    bool IsCodeGenOnly = RI.IsCodeGenOnly;
-    bool ForceDisassemble = RI.ForceDisassemble;
-    uint8_t Form = RI.Form;
     if ( // Filter non-X86 instructions
         !Def->isSubClassOf("X86Inst") ||
         // Skip pseudo instructions as they may contain non-alnum characters in
         // mnemonic
-        (IsCodeGenOnly && !ForceDisassemble) ||
+        (RI.IsCodeGenOnly && !RI.ForceDisassemble) ||
         // Non-parsable instruction defs contain prefix as part of AsmString
         Def->getValueAsString("AsmVariantName") == "NonParsable" ||
         // Skip CodeGenInstructions that are not real standalone instructions
-        Form == X86Local::PrefixByte || Form == X86Local::Pseudo)
+        RI.Form == X86Local::PrefixByte || RI.Form == X86Local::Pseudo)
       continue;
     // Flatten an instruction assembly string.
     std::string AsmString = I->FlattenAsmStringVariants(I->AsmString, Variant);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122140.416985.patch
Type: text/x-patch
Size: 1304 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220321/ad264dfb/attachment.bin>


More information about the llvm-commits mailing list