Permalink
Browse files

Updated Tango 0.99.9 patch!

  • Loading branch information...
1 parent d4339e9 commit 6861e4504f856bd1e3ca83099ab6e44e675d0025 @lindquist lindquist committed Oct 23, 2010
Showing with 255 additions and 9 deletions.
  1. +255 −9 tango-0.99.9.patch
View
@@ -1,18 +1,170 @@
+Index: tango/core/rt/compiler/ldc/ldc/intrinsics.di
+===================================================================
+--- tango/core/rt/compiler/ldc/ldc/intrinsics.di (revision 5576)
++++ tango/core/rt/compiler/ldc/ldc/intrinsics.di (working copy)
+@@ -101,8 +101,16 @@
+ // Note that, unlike the standard libc function, the llvm.memcpy.* intrinsics do
+ // not return a value, and takes an extra alignment argument.
+
+-pragma(intrinsic, "llvm.memcpy.i#")
+- void llvm_memcpy(T)(void* dst, void* src, T len, uint alignment);
++version(LDC_LLVMPre28)
++{
++ pragma(intrinsic, "llvm.memcpy.i#")
++ void llvm_memcpy(T)(void* dst, void* src, T len, uint alignment);
++}
++else
++{
++ pragma(intrinsic, "llvm.memcpy.p0i8.p0i8.i#")
++ void llvm_memcpy(T)(void* dst, void* src, T len, uint alignment, bool volatile_);
++}
+
+ deprecated {
+ alias llvm_memcpy!(uint) llvm_memcpy_i32;
+@@ -116,8 +124,16 @@
+ // Note that, unlike the standard libc function, the llvm.memmove.* intrinsics
+ // do not return a value, and takes an extra alignment argument.
+
+-pragma(intrinsic, "llvm.memmove.i#")
+- void llvm_memmove(T)(void* dst, void* src, T len, uint alignment);
++version(LDC_LLVMPre28)
++{
++ pragma(intrinsic, "llvm.memmove.i#")
++ void llvm_memmove(T)(void* dst, void* src, T len, uint alignment);
++}
++else
++{
++ pragma(intrinsic, "llvm.memmove.p0i8.p0i8.i#")
++ void llvm_memmove(T)(void* dst, void* src, T len, uint alignment, bool volatile_);
++}
+
+ deprecated {
+ alias llvm_memmove!(uint) llvm_memmove_i32;
+@@ -130,8 +146,16 @@
+ // Note that, unlike the standard libc function, the llvm.memset intrinsic does
+ // not return a value, and takes an extra alignment argument.
+
+-pragma(intrinsic, "llvm.memset.i#")
+- void llvm_memset(T)(void* dst, ubyte val, T len, uint alignment);
++version(LDC_LLVMPre28)
++{
++ pragma(intrinsic, "llvm.memset.i#")
++ void llvm_memset(T)(void* dst, ubyte val, T len, uint alignment);
++}
++else
++{
++ pragma(intrinsic, "llvm.memset.p0i8.i#")
++ void llvm_memset(T)(void* dst, ubyte val, T len, uint alignment, bool volatile_);
++}
+
+ deprecated {
+ alias llvm_memset!(uint) llvm_memset_i32;
Index: tango/core/rt/compiler/ldc/rt/lifetime.d
===================================================================
---- tango/core/rt/compiler/ldc/rt/lifetime.d (revision 5462)
+--- tango/core/rt/compiler/ldc/rt/lifetime.d (revision 5576)
+++ tango/core/rt/compiler/ldc/rt/lifetime.d (working copy)
-@@ -786,6 +786,7 @@
+@@ -241,7 +241,7 @@
+ }
+
+ /**
+- * As _d_newarrayT, but
++ * As _d_newarrayT, but
+ * for when the array has a non-zero initializer.
+ */
+ extern (C) void* _d_newarrayiT(TypeInfo ti, size_t length)
+@@ -359,7 +359,7 @@
+
+
+ /**
+- * As _d_newarraymT, but
++ * As _d_newarraymT, but
+ * for when the array has a non-zero initializer.
+ */
+ extern (C) void* _d_newarraymiT(TypeInfo ti, int ndims, size_t* dims)
+@@ -483,7 +483,7 @@
+ // if (p)
+ // {
+ // This assert on array consistency may fail with casts or in unions.
+-// This function still does something sensible even if plength && !pdata.
++// This function still does something sensible even if plength && !pdata.
+ // assert(!plength || pdata);
+
+ if (pdata)
+@@ -505,9 +505,9 @@
+ }
+ }
+
+-/**
+- *
+- */
++/**
++ *
++ */
+ extern (C) void _d_callinterfacefinalizer(void *p)
+ {
+ if (p)
+@@ -544,9 +544,9 @@
+
+ if (p) // not necessary if called from gc
+ {
+- if (det)
+- (cast(Object)p).dispose();
+-
++ if (det)
++ (cast(Object)p).dispose();
++
+ ClassInfo** pc = cast(ClassInfo**)p;
+
+ if (*pc)
+@@ -593,7 +593,7 @@
+ {
+ assert(ti);
+ // This assert on array consistency may fail with casts or in unions.
+-// This function still does something sensible even if plength && !pdata.
++// This function still does something sensible even if plength && !pdata.
+ // assert(!plength || pdata);
+ }
+ body
+@@ -651,7 +651,6 @@
+ return newdata;
+ }
+
+-
+ /**
+ * Resize arrays for non-zero initializers.
+ * p pointer to array lvalue to be updated
+@@ -664,7 +663,7 @@
+ in
+ {
+ // This assert on array consistency may fail with casts or in unions.
+-// This function still does something sensible even if plength && !pdata.
++// This function still does something sensible even if plength && !pdata.
+ // assert(!plength || pdata);
+ }
+ body
+@@ -786,6 +785,7 @@
return *cast(long*)px;
}
++/
/**
*
-@@ -849,10 +850,11 @@
-
+@@ -824,8 +824,8 @@
+ const size_t b=0; // flatness factor, how fast the extra space decreases with array size
+ const size_t a=100; // allocate at most a% of the requested size as extra space (rounding will change this)
+ const size_t minBits=1; // minimum bit size
+-
+
++
+ static size_t log2plusB(size_t c)
+ {
+ // could use the bsr bit op
+@@ -847,12 +847,12 @@
+ return newcap;
+ }
+-
/**
- *
+ * Appends a single element to an array.
@@ -24,7 +176,7 @@ Index: tango/core/rt/compiler/ldc/rt/lifetime.d
auto sizeelem = ti.next.tsize(); // array element size
auto info = gc_query(x.ptr);
auto length = x.length;
-@@ -879,16 +881,16 @@
+@@ -879,18 +879,19 @@
assert(newcap >= newlength * sizeelem);
newdata = cast(byte *)gc_malloc(newcap + 1, info.attr);
memcpy(newdata, x.ptr, length * sizeelem);
@@ -44,18 +196,51 @@ Index: tango/core/rt/compiler/ldc/rt/lifetime.d
+ return *x;
}
++/+
-@@ -1128,6 +1130,7 @@
+ /**
+ * Append dchar to char[]
+@@ -1128,7 +1129,6 @@
return result;
}
-+/+
-
+-
/**
*
+ */
+Index: tango/core/rt/compiler/ldc/rt/arrayInit.d
+===================================================================
+--- tango/core/rt/compiler/ldc/rt/arrayInit.d (revision 5576)
++++ tango/core/rt/compiler/ldc/rt/arrayInit.d (working copy)
+@@ -114,7 +114,10 @@
+ auto p = a;
+ auto end = a + na*nv;
+ while (p !is end) {
+- llvm_memcpy(p,v,nv,0);
++ version(LDC_LLVMPre28)
++ llvm_memcpy(p,v,nv,0);
++ else
++ llvm_memcpy(p,v,nv,1, false);
+ p += nv;
+ }
+ }
+@@ -164,7 +167,12 @@
+ if (dstlen != srclen)
+ throw new Exception("lengths don't match for array copy");
+ else if (dst+dstlen <= src || src+srclen <= dst)
+- llvm_memcpy(dst, src, dstlen, 0);
++ {
++ version(LDC_LLVMPre28)
++ llvm_memcpy(dst, src, dstlen, 0);
++ else
++ llvm_memcpy(dst, src, dstlen, 1, false);
++ }
+ else
+ throw new Exception("overlapping array copy");
+ }
Index: tango/core/rt/compiler/ldc/rt/eh.d
===================================================================
---- tango/core/rt/compiler/ldc/rt/eh.d (revision 5462)
+--- tango/core/rt/compiler/ldc/rt/eh.d (revision 5576)
+++ tango/core/rt/compiler/ldc/rt/eh.d (working copy)
@@ -1,38 +1,34 @@
/**
@@ -700,3 +885,64 @@ Index: tango/core/rt/compiler/ldc/rt/eh.d
- _Unwind_Resume(&exception_struct.unwind_info);
+ _Unwind_Resume(&(cast(_d_exception*)exception_struct).unwind_info);
}
+Index: tango/core/vendor/ldc/intrinsics.di
+===================================================================
+--- tango/core/vendor/ldc/intrinsics.di (revision 5576)
++++ tango/core/vendor/ldc/intrinsics.di (working copy)
+@@ -101,8 +101,16 @@
+ // Note that, unlike the standard libc function, the llvm.memcpy.* intrinsics do
+ // not return a value, and takes an extra alignment argument.
+
+-pragma(intrinsic, "llvm.memcpy.i#")
+- void llvm_memcpy(T)(void* dst, void* src, T len, uint alignment);
++version(LDC_LLVMPre28)
++{
++ pragma(intrinsic, "llvm.memcpy.i#")
++ void llvm_memcpy(T)(void* dst, void* src, T len, uint alignment);
++}
++else
++{
++ pragma(intrinsic, "llvm.memcpy.p0i8.p0i8.i#")
++ void llvm_memcpy(T)(void* dst, void* src, T len, uint alignment, bool volatile_);
++}
+
+ deprecated {
+ alias llvm_memcpy!(uint) llvm_memcpy_i32;
+@@ -116,8 +124,16 @@
+ // Note that, unlike the standard libc function, the llvm.memmove.* intrinsics
+ // do not return a value, and takes an extra alignment argument.
+
+-pragma(intrinsic, "llvm.memmove.i#")
+- void llvm_memmove(T)(void* dst, void* src, T len, uint alignment);
++version(LDC_LLVMPre28)
++{
++ pragma(intrinsic, "llvm.memmove.i#")
++ void llvm_memmove(T)(void* dst, void* src, T len, uint alignment);
++}
++else
++{
++ pragma(intrinsic, "llvm.memmove.p0i8.p0i8.i#")
++ void llvm_memmove(T)(void* dst, void* src, T len, uint alignment, bool volatile_);
++}
+
+ deprecated {
+ alias llvm_memmove!(uint) llvm_memmove_i32;
+@@ -130,8 +146,16 @@
+ // Note that, unlike the standard libc function, the llvm.memset intrinsic does
+ // not return a value, and takes an extra alignment argument.
+
+-pragma(intrinsic, "llvm.memset.i#")
+- void llvm_memset(T)(void* dst, ubyte val, T len, uint alignment);
++version(LDC_LLVMPre28)
++{
++ pragma(intrinsic, "llvm.memset.i#")
++ void llvm_memset(T)(void* dst, ubyte val, T len, uint alignment);
++}
++else
++{
++ pragma(intrinsic, "llvm.memset.p0i8.i#")
++ void llvm_memset(T)(void* dst, ubyte val, T len, uint alignment, bool volatile_);
++}
+
+ deprecated {
+ alias llvm_memset!(uint) llvm_memset_i32;

0 comments on commit 6861e45

Please sign in to comment.