Mercurial > projects > ldc
comparison gen/d-asm-i386.h @ 305:2b72433d5c8c trunk
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
Fixed problems with label collisions when using labels inside inline asm. LabelStatement is now easily reached given its
Identifier, which should be useful elsewhere too.
Enabled inline asm for building the lib/compiler/llvmdc runtime code, fixing branches out of asm makes this possible.
author | lindquist |
---|---|
date | Fri, 27 Jun 2008 22:04:35 +0200 |
parents | 3ebc136702dd |
children | 0baca2feb554 |
comparison
equal
deleted
inserted
replaced
304:3ebc136702dd | 305:2b72433d5c8c |
---|---|
1418 insnTemplate->writestring((char*) fmtpost); | 1418 insnTemplate->writestring((char*) fmtpost); |
1419 asmcode->args.push( new AsmArg(type, e, mode) ); | 1419 asmcode->args.push( new AsmArg(type, e, mode) ); |
1420 } | 1420 } |
1421 | 1421 |
1422 void addLabel(char* id) { | 1422 void addLabel(char* id) { |
1423 insnTemplate->writestring(sc->func->mangle()); | |
1424 insnTemplate->writestring("_"); | |
1423 insnTemplate->writestring(id); | 1425 insnTemplate->writestring(id); |
1424 } | 1426 } |
1425 | 1427 |
1426 /* Determines whether the operand is a register, memory reference | 1428 /* Determines whether the operand is a register, memory reference |
1427 or immediate. Immediate addresses are currently classified as | 1429 or immediate. Immediate addresses are currently classified as |
1900 if (isDollar(e)) { | 1902 if (isDollar(e)) { |
1901 error("dollar labels are not supported", stmt->loc.toChars()); | 1903 error("dollar labels are not supported", stmt->loc.toChars()); |
1902 asmcode->dollarLabel = 1; | 1904 asmcode->dollarLabel = 1; |
1903 } else if (e->op == TOKdsymbol) { | 1905 } else if (e->op == TOKdsymbol) { |
1904 LabelDsymbol * lbl = (LabelDsymbol *) ((DsymbolExp *) e)->s; | 1906 LabelDsymbol * lbl = (LabelDsymbol *) ((DsymbolExp *) e)->s; |
1905 stmt->isBranchToLabel = lbl; | 1907 stmt->isBranchToLabel = lbl->ident; |
1906 | 1908 |
1907 use_star = false; | 1909 use_star = false; |
1908 addLabel(lbl->ident->toChars()); | 1910 addLabel(lbl->ident->toChars()); |
1909 } else if ((decl && decl->isCodeseg())) { // if function or label | 1911 } else if ((decl && decl->isCodeseg())) { // if function or label |
1910 use_star = false; | 1912 use_star = false; |