mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-18 01:39:03 +02:00
[svn r248] Fixed: labels in inline asm block now work for the normal case.
Fixed: inline asm blocks are now emitted as a single asm entity.
This commit is contained in:
@@ -3186,7 +3186,7 @@ Statement *Parser::parseStatement(int flags)
|
||||
}
|
||||
break;
|
||||
}
|
||||
s = new CompoundStatement(loc, statements);
|
||||
s = new AsmBlockStatement(loc, statements);
|
||||
nextToken();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ Statement *CompoundStatement::semantic(Scope *sc)
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (statements->dim == 1)
|
||||
if (statements->dim == 1 && !isAsmBlockStatement())
|
||||
return s;
|
||||
return this;
|
||||
}
|
||||
@@ -3593,9 +3593,7 @@ LabelDsymbol::LabelDsymbol(Identifier *ident)
|
||||
: Dsymbol(ident)
|
||||
{
|
||||
statement = NULL;
|
||||
#if IN_GCC
|
||||
asmLabelNum = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
LabelDsymbol *LabelDsymbol::isLabel() // is this a LabelDsymbol()?
|
||||
|
||||
@@ -41,6 +41,7 @@ struct CompoundStatement;
|
||||
struct Argument;
|
||||
struct StaticAssert;
|
||||
struct AsmStatement;
|
||||
struct AsmBlockStatement;
|
||||
struct GotoStatement;
|
||||
struct ScopeStatement;
|
||||
struct TryCatchStatement;
|
||||
@@ -90,6 +91,7 @@ struct Statement : Object
|
||||
virtual TryCatchStatement *isTryCatchStatement() { return NULL; }
|
||||
virtual GotoStatement *isGotoStatement() { return NULL; }
|
||||
virtual AsmStatement *isAsmStatement() { return NULL; }
|
||||
virtual AsmBlockStatement *isAsmBlockStatement() { return NULL; }
|
||||
#ifdef _DH
|
||||
int incontract;
|
||||
#endif
|
||||
@@ -754,7 +756,8 @@ struct LabelStatement : Statement
|
||||
Statement *inlineScan(InlineScanState *iss);
|
||||
|
||||
void toIR(IRState *irs);
|
||||
|
||||
|
||||
// LLVMDC
|
||||
llvm::BasicBlock* llvmBB;
|
||||
};
|
||||
|
||||
@@ -788,4 +791,13 @@ struct AsmStatement : Statement
|
||||
void toIR(IRState *irs);
|
||||
};
|
||||
|
||||
struct AsmBlockStatement : CompoundStatement
|
||||
{
|
||||
AsmBlockStatement(Loc loc, Statements *s);
|
||||
Statements *flatten(Scope *sc);
|
||||
AsmBlockStatement *isAsmBlockStatement() { return this; }
|
||||
|
||||
void toIR(IRState *irs);
|
||||
};
|
||||
|
||||
#endif /* DMD_STATEMENT_H */
|
||||
|
||||
Reference in New Issue
Block a user