mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-03 16:21:41 +00:00
Allow initializing variable initializers with variables
llvm-svn: 7354
This commit is contained in:
parent
e3e77de966
commit
590c74e14d
@ -127,6 +127,15 @@ Init *RecordRecTy::convertValue(DefInit *DI) {
|
|||||||
return DI;
|
return DI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Init *RecordRecTy::convertValue(TypedInit *VI) {
|
||||||
|
// Ensure that VI is compatible with Rec.
|
||||||
|
if (RecordRecTy *RRT = dynamic_cast<RecordRecTy*>(VI->getType()))
|
||||||
|
if (RRT->getRecord()->isSubClassOf(getRecord()) ||
|
||||||
|
RRT->getRecord() == getRecord())
|
||||||
|
return VI;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Initializer implementations
|
// Initializer implementations
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -137,6 +137,7 @@ public:
|
|||||||
|
|
||||||
Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
|
Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
|
||||||
Init *convertValue( DefInit *DI);
|
Init *convertValue( DefInit *DI);
|
||||||
|
Init *convertValue(TypedInit *VI);
|
||||||
|
|
||||||
void print(std::ostream &OS) const;
|
void print(std::ostream &OS) const;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user