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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [opt/] [new1.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/39367
2
// { dg-options "-O" }
3
 
4
class QScriptEnginePrivate;
5
class QScriptClassInfo;
6
namespace QScript {
7
    enum Type { InvalidType };
8
};
9
class QScriptValueImpl {
10
public:
11
    inline QScriptValueImpl();
12
    QScript::Type m_type;
13
};
14
namespace QScript {
15
    namespace Ecma {
16
        class Core {
17
        public:
18
            inline QScriptEnginePrivate *engine() const     { }
19
            inline QScriptClassInfo *classInfo() const     { }
20
            QScriptValueImpl publicPrototype;
21
        };
22
        class Boolean: public Core {
23
            void newBoolean(QScriptValueImpl *result, bool value = false);
24
        };
25
    }
26
    template  class Buffer     {
27
    public:
28
        inline void reserve(int num);
29
        inline void resize(int s);
30
        T *m_data;
31
        int m_capacity;
32
        int m_size;
33
    };
34
}
35
template  void QScript::Buffer::resize(int s) {
36
    if (m_capacity < s)
37
      reserve (s << 1);
38
}
39
template  void QScript::Buffer::reserve(int x) {
40
    T *new_data = new T[m_capacity];
41
    for (int i=0; i
42
      new_data[i] = m_data[i];
43
}
44
class QScriptObject {
45
public:
46
    inline void reset();
47
    QScript::Buffer m_values;
48
};
49
class QScriptEnginePrivate {
50
public:
51
  inline QScriptObject *allocObject() { return 0; }
52
    inline void newObject(QScriptValueImpl *o, const QScriptValueImpl &proto,
53
                          QScriptClassInfo *oc = 0);
54
};
55
inline void QScriptEnginePrivate::newObject(QScriptValueImpl *o,
56
                                            const QScriptValueImpl &proto,
57
                                            QScriptClassInfo *oc)
58
{
59
  QScriptObject *od = allocObject();
60
  od->reset();
61
}
62
inline QScriptValueImpl::QScriptValueImpl() : m_type(QScript::InvalidType) { }
63
inline void QScriptObject::reset() { m_values.resize(0); }
64
namespace QScript {
65
    namespace Ecma {
66
        void Boolean::newBoolean(QScriptValueImpl *result, bool value)
67
          {
68
            engine()->newObject(result, publicPrototype, classInfo());
69
          }
70
    }
71
}

powered by: WebSVN 2.1.0

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