[llvm] 4a17ded - [TableGen] Remove BitsRecTy::typeIsA override. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 09:56:52 PDT 2023


Author: Craig Topper
Date: 2023-04-20T09:56:08-07:00
New Revision: 4a17ded97ff9156bb7674e8960d83cc717778335

URL: https://github.com/llvm/llvm-project/commit/4a17ded97ff9156bb7674e8960d83cc717778335
DIFF: https://github.com/llvm/llvm-project/commit/4a17ded97ff9156bb7674e8960d83cc717778335.diff

LOG: [TableGen] Remove BitsRecTy::typeIsA override. NFC

BitsRecTy objects are uniqued based on size. If the sizes are equal, then
the BitsRecTy objects are the same objects. We can use the base class
implementation that checks for pointer equality.

Added: 
    

Modified: 
    llvm/include/llvm/TableGen/Record.h
    llvm/lib/TableGen/Record.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/TableGen/Record.h b/llvm/include/llvm/TableGen/Record.h
index 6326d62d34865..b4f06a9adcfc5 100644
--- a/llvm/include/llvm/TableGen/Record.h
+++ b/llvm/include/llvm/TableGen/Record.h
@@ -142,8 +142,6 @@ class BitsRecTy : public RecTy {
   std::string getAsString() const override;
 
   bool typeIsConvertibleTo(const RecTy *RHS) const override;
-
-  bool typeIsA(const RecTy *RHS) const override;
 };
 
 /// 'int' - Represent an integer value of no particular size

diff  --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index 7e0da04e1c113..df1a4d47ff96e 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -151,12 +151,6 @@ bool BitsRecTy::typeIsConvertibleTo(const RecTy *RHS) const {
   return (kind == BitRecTyKind && Size == 1) || (kind == IntRecTyKind);
 }
 
-bool BitsRecTy::typeIsA(const RecTy *RHS) const {
-  if (const BitsRecTy *RHSb = dyn_cast<BitsRecTy>(RHS))
-    return RHSb->Size == Size;
-  return false;
-}
-
 IntRecTy *IntRecTy::get(RecordKeeper &RK) {
   return &RK.getImpl().SharedIntRecTy;
 }


        


More information about the llvm-commits mailing list