mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-07 10:07:17 +00:00
TableGen: Add strict assertions to sanity check earlier type checking
Summary: Both of these errors should have been caught by type-checking during parsing. Change-Id: I891087936fd1a91d21bcda57c256e3edbe12b94d Reviewers: arsenm, craig.topper, tra, MartinO Subscribers: wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D43558 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325800 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6d22c1fe69
commit
f410ef7d96
@ -1241,6 +1241,8 @@ public:
|
||||
bool setValue(Init *V) {
|
||||
if (V) {
|
||||
Value = V->convertInitializerTo(getType());
|
||||
assert(!Value || !isa<TypedInit>(Value) ||
|
||||
cast<TypedInit>(Value)->getType()->typeIsConvertibleTo(getType()));
|
||||
return Value == nullptr;
|
||||
}
|
||||
Value = nullptr;
|
||||
|
@ -478,6 +478,9 @@ ListInit *ListInit::get(ArrayRef<Init *> Range, RecTy *EltTy) {
|
||||
if (ListInit *I = ThePool.FindNodeOrInsertPos(ID, IP))
|
||||
return I;
|
||||
|
||||
assert(Range.empty() || !isa<TypedInit>(Range[0]) ||
|
||||
cast<TypedInit>(Range[0])->getType()->typeIsConvertibleTo(EltTy));
|
||||
|
||||
void *Mem = Allocator.Allocate(totalSizeToAlloc<Init *>(Range.size()),
|
||||
alignof(ListInit));
|
||||
ListInit *I = new(Mem) ListInit(Range.size(), EltTy);
|
||||
|
Loading…
x
Reference in New Issue
Block a user