mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
Make SubRegIndex size mandatory, following r183020.
This also makes TableGen able to compute sizes/offsets of synthesized indices representing tuples. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183061 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1092,11 +1092,24 @@ getConcatSubRegIndex(const SmallVector<CodeGenSubRegIndex*, 8> &Parts) {
|
||||
|
||||
// None exists, synthesize one.
|
||||
std::string Name = Parts.front()->getName();
|
||||
// Determine whether all parts are contiguous.
|
||||
bool isContinuous = true;
|
||||
unsigned Size = Parts.front()->Size;
|
||||
unsigned LastOffset = Parts.front()->Offset;
|
||||
unsigned LastSize = Parts.front()->Size;
|
||||
for (unsigned i = 1, e = Parts.size(); i != e; ++i) {
|
||||
Name += '_';
|
||||
Name += Parts[i]->getName();
|
||||
Size += Parts[i]->Size;
|
||||
if (Parts[i]->Offset != (LastOffset + LastSize))
|
||||
isContinuous = false;
|
||||
LastOffset = Parts[i]->Offset;
|
||||
LastSize = Parts[i]->Size;
|
||||
}
|
||||
return Idx = createSubRegIndex(Name, Parts.front()->getNamespace());
|
||||
Idx = createSubRegIndex(Name, Parts.front()->getNamespace());
|
||||
Idx->Size = Size;
|
||||
Idx->Offset = isContinuous ? Parts.front()->Offset : -1;
|
||||
return Idx;
|
||||
}
|
||||
|
||||
void CodeGenRegBank::computeComposites() {
|
||||
|
Reference in New Issue
Block a user