Mercurial > projects > ldc
comparison lphobos/internal/arrays.d @ 100:5071469303d4 trunk
[svn r104] TONS OF FIXES.
Split up declaration, constant initializer gen and definition for globals, structs, classes and functions.
Improved ClassInfo support (not complete), not in vtable yet.
Fixed a bunch of forward reference problems.
Much more. Major commit! :)
author | lindquist |
---|---|
date | Fri, 16 Nov 2007 08:21:47 +0100 |
parents | 61615fa85940 |
children | 5ab8e92611f9 |
comparison
equal
deleted
inserted
replaced
99:a676a7743642 | 100:5071469303d4 |
---|---|
86 llvm_memcpy(p,v,nv,0); | 86 llvm_memcpy(p,v,nv,0); |
87 p += nv; | 87 p += nv; |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 // array comparison routines | |
92 | |
93 bool _d_static_array_eq(void* lhs, void* rhs, size_t bytesize) | |
94 { | |
95 if (lhs is rhs) | |
96 return true; | |
97 return memcmp(lhs,rhs,bytesize) == 0; | |
98 } | |
99 | |
100 bool _d_static_array_neq(void* lhs, void* rhs, size_t bytesize) | |
101 { | |
102 if (lhs is rhs) | |
103 return false; | |
104 return memcmp(lhs,rhs,bytesize) != 0; | |
105 } | |
106 | |
107 bool _d_dyn_array_eq(void[] lhs, void[] rhs) | |
108 { | |
109 if (lhs.length != rhs.length) | |
110 return false; | |
111 else if (lhs is rhs) | |
112 return true; | |
113 return memcmp(lhs.ptr,rhs.ptr,lhs.length) == 0; | |
114 } | |
115 | |
116 bool _d_dyn_array_neq(void[] lhs, void[] rhs) | |
117 { | |
118 if (lhs.length != rhs.length) | |
119 return true; | |
120 else if (lhs is rhs) | |
121 return false; | |
122 return memcmp(lhs.ptr,rhs.ptr,lhs.length) != 0; | |
123 } | |
124 | |
125 // for array cast | 91 // for array cast |
126 size_t _d_array_cast_len(size_t len, size_t elemsz, size_t newelemsz) | 92 size_t _d_array_cast_len(size_t len, size_t elemsz, size_t newelemsz) |
127 { | 93 { |
128 if (newelemsz == 1) { | 94 if (newelemsz == 1) { |
129 return len*elemsz; | 95 return len*elemsz; |