OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr42704.C] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do compile } */
2
 
3
typedef int PRInt32;
4
class nsTreeRows {
5
    class Subtree { };
6
    enum { kMaxDepth = 32 };
7
    struct Link {
8
        Subtree* mParent;
9
        PRInt32 mChildIndex;
10
        Link&         operator=(const Link& aLink) {
11
            mParent = aLink.mParent;
12
            mChildIndex = aLink.mChildIndex;
13
        }
14
    };
15
    class iterator {
16
        PRInt32 mTop;
17
        PRInt32 mRowIndex;
18
        Link mLink[kMaxDepth];
19
    public:
20
        iterator() : mTop(-1), mRowIndex(-1) { }
21
        iterator& operator=(const iterator& aIterator);
22
    };
23
    Subtree*     EnsureSubtreeFor(Subtree* aParent, PRInt32 aChildIndex);
24
    Subtree*     GetSubtreeFor(const Subtree* aParent,
25
PRInt32 aChildIndex,                   PRInt32* aSubtreeSize = 0);
26
    void     InvalidateCachedRow() {
27
        mLastRow = iterator();
28
    }
29
    iterator mLastRow;
30
};
31
nsTreeRows::Subtree* nsTreeRows::EnsureSubtreeFor(Subtree* aParent,
32
                     PRInt32 aChildIndex) {
33
    Subtree* subtree = GetSubtreeFor(aParent, aChildIndex);
34
    if (! subtree) {
35
        InvalidateCachedRow();
36
    }
37
}
38
nsTreeRows::iterator& nsTreeRows::iterator::operator=(const iterator&
39
aIterator) {
40
    mTop = aIterator.mTop;
41
    for (PRInt32 i = mTop;
42
         i >= 0;
43
         --i)         mLink[i] = aIterator.mLink[i];
44
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.