mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-29 22:39:31 +00:00
Output types in reverse postorder. This will allow the ByteCode/Reader
to create the minimum number of opaque types for each type with a cycle in its type graph. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9615 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
60048b8a66
commit
74fa84fcef
@ -287,12 +287,20 @@ int SlotCalculator::insertValue(const Value *D, bool dontIgnore) {
|
|||||||
SC_DEBUG(" Inserted type: " << TheTy->getDescription() << " slot=" <<
|
SC_DEBUG(" Inserted type: " << TheTy->getDescription() << " slot=" <<
|
||||||
ResultSlot << "\n");
|
ResultSlot << "\n");
|
||||||
|
|
||||||
// Loop over any contained types in the definition... in depth first order.
|
// Loop over any contained types in the definition... in reverse depth
|
||||||
|
// first order.
|
||||||
//
|
//
|
||||||
|
std::vector<const Type*> DfsOrder;
|
||||||
for (df_iterator<const Type*> I = df_begin(TheTy), E = df_end(TheTy);
|
for (df_iterator<const Type*> I = df_begin(TheTy), E = df_end(TheTy);
|
||||||
I != E; ++I)
|
I != E; ++I) {
|
||||||
if (*I != TheTy) {
|
if (*I != TheTy) {
|
||||||
// If we haven't seen this sub type before, add it to our type table!
|
// If we haven't seen this sub type before, add it to our type table!
|
||||||
|
DfsOrder.push_back(*I);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (std::vector<const Type*>::const_reverse_iterator
|
||||||
|
I = DfsOrder.rbegin(), E = DfsOrder.rend(); I != E; ++I) {
|
||||||
const Type *SubTy = *I;
|
const Type *SubTy = *I;
|
||||||
if (getSlot(SubTy) == -1) {
|
if (getSlot(SubTy) == -1) {
|
||||||
SC_DEBUG(" Inserting subtype: " << SubTy->getDescription() << "\n");
|
SC_DEBUG(" Inserting subtype: " << SubTy->getDescription() << "\n");
|
||||||
|
@ -287,12 +287,20 @@ int SlotCalculator::insertValue(const Value *D, bool dontIgnore) {
|
|||||||
SC_DEBUG(" Inserted type: " << TheTy->getDescription() << " slot=" <<
|
SC_DEBUG(" Inserted type: " << TheTy->getDescription() << " slot=" <<
|
||||||
ResultSlot << "\n");
|
ResultSlot << "\n");
|
||||||
|
|
||||||
// Loop over any contained types in the definition... in depth first order.
|
// Loop over any contained types in the definition... in reverse depth
|
||||||
|
// first order.
|
||||||
//
|
//
|
||||||
|
std::vector<const Type*> DfsOrder;
|
||||||
for (df_iterator<const Type*> I = df_begin(TheTy), E = df_end(TheTy);
|
for (df_iterator<const Type*> I = df_begin(TheTy), E = df_end(TheTy);
|
||||||
I != E; ++I)
|
I != E; ++I) {
|
||||||
if (*I != TheTy) {
|
if (*I != TheTy) {
|
||||||
// If we haven't seen this sub type before, add it to our type table!
|
// If we haven't seen this sub type before, add it to our type table!
|
||||||
|
DfsOrder.push_back(*I);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (std::vector<const Type*>::const_reverse_iterator
|
||||||
|
I = DfsOrder.rbegin(), E = DfsOrder.rend(); I != E; ++I) {
|
||||||
const Type *SubTy = *I;
|
const Type *SubTy = *I;
|
||||||
if (getSlot(SubTy) == -1) {
|
if (getSlot(SubTy) == -1) {
|
||||||
SC_DEBUG(" Inserting subtype: " << SubTy->getDescription() << "\n");
|
SC_DEBUG(" Inserting subtype: " << SubTy->getDescription() << "\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user