Mercurial > projects > ldc
comparison gen/asmstmt.cpp @ 239:fa691b1c0498 trunk
[svn r256] AsmBlockStatement was still being flattened in some cases.
Function parameters passed as arguments to inline asm was not given storage.
author | lindquist |
---|---|
date | Sun, 08 Jun 2008 22:07:10 +0200 |
parents | a168a2c3ea48 |
children | df8a7b8d5929 |
comparison
equal
deleted
inserted
replaced
238:346cba22f4b8 | 239:fa691b1c0498 |
---|---|
243 if (! asmcode) | 243 if (! asmcode) |
244 return; | 244 return; |
245 | 245 |
246 static std::string i_cns = "i"; | 246 static std::string i_cns = "i"; |
247 static std::string p_cns = "i"; | 247 static std::string p_cns = "i"; |
248 static std::string l_cns = "X"; | |
249 static std::string m_cns = "*m"; | 248 static std::string m_cns = "*m"; |
250 static std::string mw_cns = "=*m"; | 249 static std::string mw_cns = "=*m"; |
251 static std::string mrw_cns = "+*m"; | 250 static std::string mrw_cns = "+*m"; |
252 static std::string memory_name = "memory"; | 251 static std::string memory_name = "memory"; |
253 | 252 |
495 Logger::println("BEGIN ASM"); | 494 Logger::println("BEGIN ASM"); |
496 | 495 |
497 // create asm block structure | 496 // create asm block structure |
498 assert(!p->asmBlock); | 497 assert(!p->asmBlock); |
499 IRAsmBlock* asmblock = new IRAsmBlock; | 498 IRAsmBlock* asmblock = new IRAsmBlock; |
499 assert(asmblock); | |
500 p->asmBlock = asmblock; | 500 p->asmBlock = asmblock; |
501 | 501 |
502 // do asm statements | 502 // do asm statements |
503 for (int i=0; i<statements->dim; i++) | 503 for (int i=0; i<statements->dim; i++) |
504 { | 504 { |
593 // the whole idea of this statement is to avoid the flattening | 593 // the whole idea of this statement is to avoid the flattening |
594 Statements* AsmBlockStatement::flatten(Scope* sc) | 594 Statements* AsmBlockStatement::flatten(Scope* sc) |
595 { | 595 { |
596 return NULL; | 596 return NULL; |
597 } | 597 } |
598 | |
599 Statement *AsmBlockStatement::syntaxCopy() | |
600 { | |
601 Statements *a = new Statements(); | |
602 a->setDim(statements->dim); | |
603 for (size_t i = 0; i < statements->dim; i++) | |
604 { | |
605 Statement *s = (Statement *)statements->data[i]; | |
606 if (s) | |
607 s = s->syntaxCopy(); | |
608 a->data[i] = s; | |
609 } | |
610 AsmBlockStatement *cs = new AsmBlockStatement(loc, a); | |
611 return cs; | |
612 } |