1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

[TableGen] Remove convertValue functions for UnOpInit, BinOpInit, and TernOpInit as they weren't able to be called.

I don't think converting the inputs to the Ops was the right behavior anyway.

llvm-svn: 238543
This commit is contained in:
Craig Topper 2015-05-29 05:51:32 +00:00
parent 8585b09fb0
commit 6d0adbbb1b
2 changed files with 0 additions and 61 deletions

View File

@ -107,15 +107,6 @@ public: // These methods should only be called from subclasses of Init
virtual Init *convertValue( IntInit *II) { return nullptr; }
virtual Init *convertValue(StringInit *SI) { return nullptr; }
virtual Init *convertValue( ListInit *LI) { return nullptr; }
virtual Init *convertValue( UnOpInit *UO) {
return convertValue((TypedInit*)UO);
}
virtual Init *convertValue( BinOpInit *BO) {
return convertValue((TypedInit*)BO);
}
virtual Init *convertValue( TernOpInit *TO) {
return convertValue((TypedInit*)TO);
}
virtual Init *convertValue(VarBitInit *VB) { return nullptr; }
virtual Init *convertValue( DefInit *DI) { return nullptr; }
virtual Init *convertValue( DagInit *DI) { return nullptr; }
@ -240,8 +231,6 @@ public:
using RecTy::convertValue;
Init *convertValue( UnsetInit *UI) override { return (Init*)UI; }
Init *convertValue(StringInit *SI) override { return (Init*)SI; }
Init *convertValue( UnOpInit *UO) override;
Init *convertValue( BinOpInit *BO) override;
Init *convertValue( TypedInit *TI) override;
std::string getAsString() const override { return "string"; }
@ -296,8 +285,6 @@ public:
using RecTy::convertValue;
Init *convertValue( UnsetInit *UI) override { return (Init*)UI; }
Init *convertValue( UnOpInit *UO) override;
Init *convertValue( BinOpInit *BO) override;
Init *convertValue( DagInit *DI) override { return (Init*)DI; }
Init *convertValue( TypedInit *TI) override;

View 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());
}