[TableGen] Make BitRecTy::baseClassOf return true when RHS is an IntRecTy.
authorCraig Topper <craig.topper@gmail.com>
Wed, 22 Apr 2015 04:18:32 +0000 (04:18 +0000)
committerCraig Topper <craig.topper@gmail.com>
Wed, 22 Apr 2015 04:18:32 +0000 (04:18 +0000)
Previously the code was accidentally checking if 'this' was an IntRecTy which it can't be since 'this' is a BitRecTy. Looking back at the history it appears it was intended to check RHS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235477 91177308-0d34-0410-b5e6-96231b3b80d8

lib/TableGen/Record.cpp

index 8069682270560bd5be79b2e1a0ea025c702a6689..c032bc1925169f5b1bb215ec150e488e62d6bbb6 100644 (file)
@@ -133,7 +133,7 @@ Init *BitRecTy::convertValue(TypedInit *VI) {
 }
 
 bool BitRecTy::baseClassOf(const RecTy *RHS) const{
-  if(RecTy::baseClassOf(RHS) || getRecTyKind() == IntRecTyKind)
+  if(RecTy::baseClassOf(RHS) || RHS->getRecTyKind() == IntRecTyKind)
     return true;
   if(const BitsRecTy *BitsTy = dyn_cast<BitsRecTy>(RHS))
     return BitsTy->getNumBits() == 1;