[llvm] r326061 - TableGen: Remove VarInit::getFieldType

Nicolai Haehnle via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 25 12:50:17 PST 2018


Author: nha
Date: Sun Feb 25 12:50:17 2018
New Revision: 326061

URL: http://llvm.org/viewvc/llvm-project?rev=326061&view=rev
Log:
TableGen: Remove VarInit::getFieldType

It is redundant with the implementation in TypedInit.

Change-Id: I8ab1fb5c77e4923f7eb3ffae5889f0f8af6093b4

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

Differential Revision: https://reviews.llvm.org/D43678

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

Modified: llvm/trunk/include/llvm/TableGen/Record.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/TableGen/Record.h?rev=326061&r1=326060&r2=326061&view=diff
==============================================================================
--- llvm/trunk/include/llvm/TableGen/Record.h (original)
+++ llvm/trunk/include/llvm/TableGen/Record.h Sun Feb 25 12:50:17 2018
@@ -892,8 +892,6 @@ public:
     return getNameInit()->getAsUnquotedString();
   }
 
-  RecTy *getFieldType(StringInit *FieldName) const override;
-
   /// This method is used by classes that refer to other
   /// variables which may not be defined at the time they expression is formed.
   /// If a value is set for the variable later, this method will be called on

Modified: llvm/trunk/lib/TableGen/Record.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Record.cpp?rev=326061&r1=326060&r2=326061&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/Record.cpp (original)
+++ llvm/trunk/lib/TableGen/Record.cpp Sun Feb 25 12:50:17 2018
@@ -1248,13 +1248,6 @@ Init *VarInit::getBit(unsigned Bit) cons
   return VarBitInit::get(const_cast<VarInit*>(this), Bit);
 }
 
-RecTy *VarInit::getFieldType(StringInit *FieldName) const {
-  if (RecordRecTy *RTy = dyn_cast<RecordRecTy>(getType()))
-    if (const RecordVal *RV = RTy->getRecord()->getValue(FieldName))
-      return RV->getType();
-  return nullptr;
-}
-
 Init *VarInit::resolveReferences(Record &R, const RecordVal *RV) const {
   if (RecordVal *Val = R.getValue(VarName))
     if (RV == Val || (!RV && !isa<UnsetInit>(Val->getValue())))




More information about the llvm-commits mailing list