mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Allow passing lists through variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7407 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -116,6 +116,14 @@ Init *ListRecTy::convertValue(ListInit *LI) {
|
||||
return LI;
|
||||
}
|
||||
|
||||
Init *ListRecTy::convertValue(TypedInit *TI) {
|
||||
// Ensure that TI is compatible with our class.
|
||||
if (ListRecTy *LRT = dynamic_cast<ListRecTy*>(TI->getType()))
|
||||
if (LRT->getElementClass() == getElementClass())
|
||||
return TI;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void RecordRecTy::print(std::ostream &OS) const {
|
||||
OS << Rec->getName();
|
||||
}
|
||||
@@ -127,12 +135,12 @@ Init *RecordRecTy::convertValue(DefInit *DI) {
|
||||
return DI;
|
||||
}
|
||||
|
||||
Init *RecordRecTy::convertValue(TypedInit *VI) {
|
||||
// Ensure that VI is compatible with Rec.
|
||||
if (RecordRecTy *RRT = dynamic_cast<RecordRecTy*>(VI->getType()))
|
||||
Init *RecordRecTy::convertValue(TypedInit *TI) {
|
||||
// Ensure that TI is compatible with Rec.
|
||||
if (RecordRecTy *RRT = dynamic_cast<RecordRecTy*>(TI->getType()))
|
||||
if (RRT->getRecord()->isSubClassOf(getRecord()) ||
|
||||
RRT->getRecord() == getRecord())
|
||||
return VI;
|
||||
return TI;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user