# HG changeset patch # User Christian Kamm # Date 1219590123 -7200 # Node ID 8a73062f934efe3ac31e05b511998d90da35b809 # Parent 2fe2d4518618277aa6f721148a1c0c000cd15515# Parent bfbd71f605722dba5822eebf1870cf103e969440 Automated merge with http://hg.dsource.org/projects/llvmdc diff -r bfbd71f60572 -r 8a73062f934e gen/asmstmt.cpp --- a/gen/asmstmt.cpp Sun Aug 24 17:01:40 2008 +0200 +++ b/gen/asmstmt.cpp Sun Aug 24 17:02:03 2008 +0200 @@ -177,6 +177,9 @@ Logger::println("AsmStatement::toIR(): %s", loc.toChars()); LOG_SCOPE; + // sanity check + assert(irs->func()->decl->inlineAsm); + // get asm block IRAsmBlock* asmblock = irs->asmBlock; assert(asmblock); diff -r bfbd71f60572 -r 8a73062f934e runtime/llvmdc.diff --- a/runtime/llvmdc.diff Sun Aug 24 17:01:40 2008 +0200 +++ b/runtime/llvmdc.diff Sun Aug 24 17:02:03 2008 +0200 @@ -88,33 +88,54 @@ =================================================================== --- lib/common/tango/core/Thread.d (revision 3899) +++ lib/common/tango/core/Thread.d (working copy) -@@ -255,6 +255,10 @@ - { - __builtin_unwind_init(); - } -+ else version( LLVMDC ) -+ { -+ pragma(msg, "don't know how to push registers on the stack for this architecture with LLVMDC"); -+ } - else +@@ -244,8 +244,30 @@ + } + body + { +- version( D_InlineAsm_X86 ) ++ version( LLVMDC) { - static assert( false, "Architecture not supported." ); -@@ -308,6 +312,10 @@ - { - // registers will be popped automatically ++ version(X86) ++ { ++ uint eax,ecx,edx,ebx,ebp,esi,edi; ++ asm ++ { ++ //pushad ; ++ mov eax[EBP], EAX ; ++ mov ecx[EBP], ECX ; ++ mov edx[EBP], EDX ; ++ mov ebx[EBP], EBX ; ++ mov ebp[EBP], EBP ; ++ mov esi[EBP], ESI ; ++ mov edi[EBP], EDI ; ++ } ++ } ++ else ++ { ++ static assert( false, "Architecture not supported." ); ++ } ++ } ++ else version( D_InlineAsm_X86 ) ++ { + asm + { + pushad; +@@ -297,6 +319,10 @@ + } } -+ else version( LLVMDC ) + ++ version( LLVMDC) + { -+ // TODO ++ // nothing to pop + } - else + version( D_InlineAsm_X86 ) { - static assert( false, "Architecture not supported." ); + asm Index: lib/gc/basic/gcx.d =================================================================== --- lib/gc/basic/gcx.d (revision 3899) +++ lib/gc/basic/gcx.d (working copy) -@@ -2178,6 +2178,21 @@ +@@ -2178,6 +2178,29 @@ __builtin_unwind_init(); sp = & sp; } @@ -122,37 +143,35 @@ + { + version(X86) + { ++ uint eax,ecx,edx,ebx,ebp,esi,edi; + asm + { -+ pushad ; ++ pushad ; ++ mov eax[EBP], EAX ; ++ mov ecx[EBP], ECX ; ++ mov edx[EBP], EDX ; ++ mov ebx[EBP], EBX ; ++ mov ebp[EBP], EBP ; ++ mov esi[EBP], ESI ; ++ mov edi[EBP], EDI ; + mov sp[EBP],ESP ; + } + } + else + { -+ pragma(msg, "don't know how to push registers on the stack for this architecture with llvmdc"); ++ static assert( false, "Architecture not supported." ); + } + } else { asm -@@ -2191,6 +2206,20 @@ +@@ -2191,6 +2214,10 @@ { // nothing to do } + else version(LLVMDC) + { -+ version(X86) -+ { -+ asm -+ { -+ popad ; -+ } -+ } -+ else -+ { -+ // TODO -+ } ++ // nothing to do + } else {