[llvm] r235477 - [TableGen] Make BitRecTy::baseClassOf return true when RHS is an IntRecTy.

Craig Topper craig.topper at gmail.com
Tue Apr 21 21:18:32 PDT 2015


Author: ctopper
Date: Tue Apr 21 23:18:32 2015
New Revision: 235477

URL: http://llvm.org/viewvc/llvm-project?rev=235477&view=rev
Log:
[TableGen] Make BitRecTy::baseClassOf return true when RHS is an IntRecTy.

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.

Modified:
    llvm/trunk/lib/TableGen/Record.cpp

Modified: llvm/trunk/lib/TableGen/Record.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Record.cpp?rev=235477&r1=235476&r2=235477&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/Record.cpp (original)
+++ llvm/trunk/lib/TableGen/Record.cpp Tue Apr 21 23:18:32 2015
@@ -133,7 +133,7 @@ Init *BitRecTy::convertValue(TypedInit *
 }
 
 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;





More information about the llvm-commits mailing list