# HG changeset patch # User Tomas Lindquist Olsen # Date 1219589477 -7200 # Node ID 2fe2d4518618277aa6f721148a1c0c000cd15515 # Parent 0beebf923322eb8e6e00bddb2b3027ab96b31c35 Reverted some changes in the Tango patch, splitting asm block is simply not supported by llvm. diff -r 0beebf923322 -r 2fe2d4518618 gen/asmstmt.cpp --- a/gen/asmstmt.cpp Thu Aug 21 15:35:39 2008 +0200 +++ b/gen/asmstmt.cpp Sun Aug 24 16:51:17 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 0beebf923322 -r 2fe2d4518618 runtime/llvmdc.diff --- a/runtime/llvmdc.diff Thu Aug 21 15:35:39 2008 +0200 +++ b/runtime/llvmdc.diff Sun Aug 24 16:51:17 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 {