changeset 1456:7b218ec1044f

Automated merge with http://hg.dsource.org/projects/ldc
author Robert Clipsham <robert@octarineparrot.com>
date Tue, 02 Jun 2009 17:12:37 +0100
parents 297d1e2f6441 (diff) 89e38fbfef1f (current diff)
children ed70675862c8 e0b2d67cfe7c
files dmd2/array.c dmd2/dchar.c dmd2/dchar.h dmd2/e2ir.c.nolink dmd2/gnuc.c dmd2/gnuc.h dmd2/link.c.nolink dmd2/lstring.c dmd2/lstring.h dmd2/man.c dmd2/port.h dmd2/root.c dmd2/root.h dmd2/stringtable.c dmd2/stringtable.h gen/toobj.cpp
diffstat 5 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gen/asm-x86-32.h	Mon Jun 01 19:02:20 2009 +0100
+++ b/gen/asm-x86-32.h	Tue Jun 02 17:12:37 2009 +0100
@@ -1100,8 +1100,10 @@
         { "subps",  Op_DstSrcSSE },
         { "subsd",  Op_DstSrcSSE },
         { "subss",  Op_DstSrcSSE },
+        { "syscall", Op_0 },
         { "sysenter",Op_0 },
         { "sysexit", Op_0 },
+        { "sysret",  Op_0 },
         { "test",    Op_SrcSrcF },
         { "ucomisd", Op_SrcSrcSSEF },
         { "ucomiss", Op_SrcSrcSSEF },
--- a/gen/asm-x86-64.h	Mon Jun 01 19:02:20 2009 +0100
+++ b/gen/asm-x86-64.h	Tue Jun 02 17:12:37 2009 +0100
@@ -730,7 +730,6 @@
         { "invlpga", Op_SrcMemNT },
         { "rdtscp",  Op_0_DXAX },
         { "stgi",    Op_Flags },
-        { "sysret", Op_0 },
         */
 
         { "cmpxch16b", Op_cmpxchg8b },
@@ -1221,6 +1220,7 @@
         { "subsd",  Op_DstSrcSSE },
         { "subss",  Op_DstSrcSSE },
         { "swapgs",  Op_DstSrcSSE },
+        { "syscall", Op_0 },
         { "sysenter",Op_0 },
         { "sysexit", Op_0 },
         { "sysret", Op_0 },
--- a/gen/tollvm.cpp	Mon Jun 01 19:02:20 2009 +0100
+++ b/gen/tollvm.cpp	Tue Jun 02 17:12:37 2009 +0100
@@ -403,6 +403,14 @@
 
 //////////////////////////////////////////////////////////////////////////////////////////
 
+LLConstant* DtoGEPi(LLConstant* ptr, unsigned i0, unsigned i1)
+{
+    LLValue* v[2] = { DtoConstUint(i0), DtoConstUint(i1) };
+    return llvm::ConstantExpr::getGetElementPtr(ptr, v, 2);
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+
 void DtoMemSetZero(LLValue* dst, LLValue* nbytes)
 {
     dst = DtoBitCast(dst,getVoidPtrType());
--- a/gen/tollvm.h	Mon Jun 01 19:02:20 2009 +0100
+++ b/gen/tollvm.h	Tue Jun 02 17:12:37 2009 +0100
@@ -48,6 +48,7 @@
 
 LLValue* DtoGEPi1(LLValue* ptr, unsigned i0, const char* var=NULL, llvm::BasicBlock* bb=NULL);
 LLValue* DtoGEPi(LLValue* ptr, unsigned i0, unsigned i1, const char* var=NULL, llvm::BasicBlock* bb=NULL);
+LLConstant* DtoGEPi(LLConstant* ptr, unsigned i0, unsigned i1);
 
 // to constant helpers
 LLConstantInt* DtoConstSize_t(uint64_t);
--- a/gen/toobj.cpp	Mon Jun 01 19:02:20 2009 +0100
+++ b/gen/toobj.cpp	Tue Jun 02 17:12:37 2009 +0100
@@ -719,11 +719,11 @@
         m_name.append("9__classesZ");
         assert(gIR->module->getGlobalVariable(m_name) == NULL);
         llvm::GlobalVariable* m_gvar = new llvm::GlobalVariable(classArrTy, true, llvm::GlobalValue::InternalLinkage, c, m_name, gIR->module);
-        c = DtoBitCast(m_gvar, getPtrToType(classinfoTy));
+        c = DtoGEPi(m_gvar, 0, 0);
         c = DtoConstSlice(DtoConstSize_t(classInits.size()), c);
     }
     else
-        c = DtoConstSlice( DtoConstSize_t(0), getNullValue(getPtrToType(classinfoTy)) );
+        c = DtoConstSlice( DtoConstSize_t(0), getNullValue(getPtrToType(getPtrToType(classinfoTy))) );
     b.push(c);
 
     // flags (4 means MIstandalone)