return 0;
}
+Init *IntRecTy::convertValue(BitInit *BI) {
+ return new IntInit(BI->getValue());
+}
+
Init *IntRecTy::convertValue(BitsInit *BI) {
int Result = 0;
for (unsigned i = 0, e = BI->getNumBits(); i != e; ++i)
}
Init *IntRecTy::convertValue(TypedInit *TI) {
- if (dynamic_cast<IntRecTy*>(TI->getType()))
+ if (TI->getType()->typeIsConvertibleTo(this))
return TI; // Accept variable if already of the right type!
return 0;
}
struct IntRecTy : public RecTy {
Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
Init *convertValue(IntInit *II) { return (Init*)II; }
+ Init *convertValue(BitInit *BI);
Init *convertValue(BitsInit *BI);
Init *convertValue(TypedInit *TI);
return 0;
}
+Init *IntRecTy::convertValue(BitInit *BI) {
+ return new IntInit(BI->getValue());
+}
+
Init *IntRecTy::convertValue(BitsInit *BI) {
int Result = 0;
for (unsigned i = 0, e = BI->getNumBits(); i != e; ++i)
}
Init *IntRecTy::convertValue(TypedInit *TI) {
- if (dynamic_cast<IntRecTy*>(TI->getType()))
+ if (TI->getType()->typeIsConvertibleTo(this))
return TI; // Accept variable if already of the right type!
return 0;
}
struct IntRecTy : public RecTy {
Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
Init *convertValue(IntInit *II) { return (Init*)II; }
+ Init *convertValue(BitInit *BI);
Init *convertValue(BitsInit *BI);
Init *convertValue(TypedInit *TI);