mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-09-19 11:50:18 +02:00
[svn r256] AsmBlockStatement was still being flattened in some cases.
Function parameters passed as arguments to inline asm was not given storage.
This commit is contained in:
+7
-4
@@ -170,13 +170,13 @@ struct CompoundStatement : Statement
|
|||||||
|
|
||||||
CompoundStatement(Loc loc, Statements *s);
|
CompoundStatement(Loc loc, Statements *s);
|
||||||
CompoundStatement(Loc loc, Statement *s1, Statement *s2);
|
CompoundStatement(Loc loc, Statement *s1, Statement *s2);
|
||||||
Statement *syntaxCopy();
|
virtual Statement *syntaxCopy();
|
||||||
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
||||||
Statement *semantic(Scope *sc);
|
Statement *semantic(Scope *sc);
|
||||||
int usesEH();
|
int usesEH();
|
||||||
int fallOffEnd();
|
int fallOffEnd();
|
||||||
int comeFrom();
|
int comeFrom();
|
||||||
Statements *flatten(Scope *sc);
|
virtual Statements *flatten(Scope *sc);
|
||||||
ReturnStatement *isReturnStatement();
|
ReturnStatement *isReturnStatement();
|
||||||
Expression *interpret(InterState *istate);
|
Expression *interpret(InterState *istate);
|
||||||
|
|
||||||
@@ -184,9 +184,9 @@ struct CompoundStatement : Statement
|
|||||||
Expression *doInline(InlineDoState *ids);
|
Expression *doInline(InlineDoState *ids);
|
||||||
Statement *inlineScan(InlineScanState *iss);
|
Statement *inlineScan(InlineScanState *iss);
|
||||||
|
|
||||||
void toIR(IRState *irs);
|
virtual void toIR(IRState *irs);
|
||||||
|
|
||||||
CompoundStatement *isCompoundStatement() { return this; }
|
virtual CompoundStatement *isCompoundStatement() { return this; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* The purpose of this is so that continue will go to the next
|
/* The purpose of this is so that continue will go to the next
|
||||||
@@ -795,6 +795,9 @@ struct AsmBlockStatement : CompoundStatement
|
|||||||
{
|
{
|
||||||
AsmBlockStatement(Loc loc, Statements *s);
|
AsmBlockStatement(Loc loc, Statements *s);
|
||||||
Statements *flatten(Scope *sc);
|
Statements *flatten(Scope *sc);
|
||||||
|
Statement *syntaxCopy();
|
||||||
|
|
||||||
|
CompoundStatement *isCompoundStatement() { return NULL; }
|
||||||
AsmBlockStatement *isAsmBlockStatement() { return this; }
|
AsmBlockStatement *isAsmBlockStatement() { return this; }
|
||||||
|
|
||||||
void toIR(IRState *irs);
|
void toIR(IRState *irs);
|
||||||
|
|||||||
+16
-1
@@ -245,7 +245,6 @@ AsmStatement::toIR(IRState * irs)
|
|||||||
|
|
||||||
static std::string i_cns = "i";
|
static std::string i_cns = "i";
|
||||||
static std::string p_cns = "i";
|
static std::string p_cns = "i";
|
||||||
static std::string l_cns = "X";
|
|
||||||
static std::string m_cns = "*m";
|
static std::string m_cns = "*m";
|
||||||
static std::string mw_cns = "=*m";
|
static std::string mw_cns = "=*m";
|
||||||
static std::string mrw_cns = "+*m";
|
static std::string mrw_cns = "+*m";
|
||||||
@@ -497,6 +496,7 @@ void AsmBlockStatement::toIR(IRState* p)
|
|||||||
// create asm block structure
|
// create asm block structure
|
||||||
assert(!p->asmBlock);
|
assert(!p->asmBlock);
|
||||||
IRAsmBlock* asmblock = new IRAsmBlock;
|
IRAsmBlock* asmblock = new IRAsmBlock;
|
||||||
|
assert(asmblock);
|
||||||
p->asmBlock = asmblock;
|
p->asmBlock = asmblock;
|
||||||
|
|
||||||
// do asm statements
|
// do asm statements
|
||||||
@@ -595,3 +595,18 @@ Statements* AsmBlockStatement::flatten(Scope* sc)
|
|||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Statement *AsmBlockStatement::syntaxCopy()
|
||||||
|
{
|
||||||
|
Statements *a = new Statements();
|
||||||
|
a->setDim(statements->dim);
|
||||||
|
for (size_t i = 0; i < statements->dim; i++)
|
||||||
|
{
|
||||||
|
Statement *s = (Statement *)statements->data[i];
|
||||||
|
if (s)
|
||||||
|
s = s->syntaxCopy();
|
||||||
|
a->data[i] = s;
|
||||||
|
}
|
||||||
|
AsmBlockStatement *cs = new AsmBlockStatement(loc, a);
|
||||||
|
return cs;
|
||||||
|
}
|
||||||
@@ -2044,6 +2044,7 @@ struct AsmProcessor
|
|||||||
}
|
}
|
||||||
} else if (exp->op == TOKvar) {
|
} else if (exp->op == TOKvar) {
|
||||||
VarDeclaration * v = ((VarExp *) exp)->var->isVarDeclaration();
|
VarDeclaration * v = ((VarExp *) exp)->var->isVarDeclaration();
|
||||||
|
v->needsStorage = true;
|
||||||
|
|
||||||
if (v && v->storage_class & STCfield) {
|
if (v && v->storage_class & STCfield) {
|
||||||
operand->constDisplacement += v->offset;
|
operand->constDisplacement += v->offset;
|
||||||
|
|||||||
Reference in New Issue
Block a user