Mercurial > projects > ldc
view tango/lib/compiler/llvmdc/typeinfo/ti_delegate.d @ 213:7816aafeea3c trunk
[svn r229] Updated the object.d implementation to the latest Tango.
Fixed a bunch of the built-in typeinfos for arrays, they did not inherit TypeInfo_Array.
Applied patch to tango/text/convert/Layout.d by fvbommel, closes #47 .
Cleaned up some type code.
Replaced uses of llvm::Type with LLType (a typedef), same for Value and Constant.
Fixed a few cases where typeinfo for user structs could be emitted multiple times, seems to still be some cases of this :/
author | lindquist |
---|---|
date | Fri, 30 May 2008 19:32:04 +0200 |
parents | 1700239cab2e |
children |
line wrap: on
line source
// delegate module typeinfo.ti_delegate; alias void delegate(int) dg; class TypeInfo_D : TypeInfo { hash_t getHash(void *p) { long l = *cast(long *)p; return cast(uint)(l + (l >> 32)); } int equals(void *p1, void *p2) { return *cast(dg *)p1 == *cast(dg *)p2; } size_t tsize() { return dg.sizeof; } void swap(void *p1, void *p2) { dg t; t = *cast(dg *)p1; *cast(dg *)p1 = *cast(dg *)p2; *cast(dg *)p2 = t; } uint flags() { return 1; } }