[TableGen] Remove convertValue functions for UnOpInit, BinOpInit, and TernOpInit...
[oota-llvm.git] / lib / TableGen / Record.cpp
index 3089a13c6bc3b940c0401664c4975eaaa1d95dbb..534411364e9e656b7a1bb4d44c6b6b4b8a970446 100644 (file)
@@ -247,31 +247,6 @@ bool IntRecTy::baseClassOf(const RecTy *RHS) const{
   return kind==BitRecTyKind || kind==BitsRecTyKind || kind==IntRecTyKind;
 }
 
-Init *StringRecTy::convertValue(UnOpInit *UO) {
-  if (UO->getOpcode() == UnOpInit::CAST) {
-    Init *L = UO->getOperand()->convertInitializerTo(this);
-    if (!L) return nullptr;
-    if (L != UO->getOperand())
-      return UnOpInit::get(UnOpInit::CAST, L, StringRecTy::get());
-    return UO;
-  }
-
-  return convertValue((TypedInit*)UO);
-}
-
-Init *StringRecTy::convertValue(BinOpInit *BO) {
-  if (BO->getOpcode() == BinOpInit::STRCONCAT) {
-    Init *L = BO->getLHS()->convertInitializerTo(this);
-    Init *R = BO->getRHS()->convertInitializerTo(this);
-    if (!L || !R) return nullptr;
-    if (L != BO->getLHS() || R != BO->getRHS())
-      return BinOpInit::get(BinOpInit::STRCONCAT, L, R, StringRecTy::get());
-    return BO;
-  }
-
-  return convertValue((TypedInit*)BO);
-}
-
 
 Init *StringRecTy::convertValue(TypedInit *TI) {
   if (isa<StringRecTy>(TI->getType()))
@@ -320,29 +295,6 @@ Init *DagRecTy::convertValue(TypedInit *TI) {
   return nullptr;
 }
 
-Init *DagRecTy::convertValue(UnOpInit *UO) {
-  if (UO->getOpcode() == UnOpInit::CAST) {
-    Init *L = UO->getOperand()->convertInitializerTo(this);
-    if (!L) return nullptr;
-    if (L != UO->getOperand())
-      return UnOpInit::get(UnOpInit::CAST, L, DagRecTy::get());
-    return UO;
-  }
-  return nullptr;
-}
-
-Init *DagRecTy::convertValue(BinOpInit *BO) {
-  if (BO->getOpcode() == BinOpInit::CONCAT) {
-    Init *L = BO->getLHS()->convertInitializerTo(this);
-    Init *R = BO->getRHS()->convertInitializerTo(this);
-    if (!L || !R) return nullptr;
-    if (L != BO->getLHS() || R != BO->getRHS())
-      return BinOpInit::get(BinOpInit::CONCAT, L, R, DagRecTy::get());
-    return BO;
-  }
-  return nullptr;
-}
-
 RecordRecTy *RecordRecTy::get(Record *R) {
   return dyn_cast<RecordRecTy>(R->getDefInit()->getType());
 }