SWITCHED TO LLVM 2.5 !

Applied patch from ticket #129 to compile against latest LLVM. Thanks Frits van Bommel.

Fixed implicit return by asm block at the end of a function on x86-32. Other architectures will produce an error at the moment. Adding support for new targets is fairly simple.

Fixed return calling convention for complex numbers, ST and ST(1) were switched around.

Added some testcases.

I've run a dstress test and there are no regressions. However, the runtime does not seem to compile with symbolic debug information. -O3 -release -inline works well and is what I used for the dstress run. Tango does not compile, a small workaround is needed in tango.io.digest.Digest.Digest.hexDigest. See ticket #206 .
This commit is contained in:
Tomas Lindquist Olsen
2009-02-08 05:26:54 +01:00
parent 3f7c7c5327
commit fc480b7fd8
29 changed files with 404 additions and 81 deletions

View File

@@ -675,6 +675,9 @@ struct FuncDeclaration : Declaration
// if this is an array operation it gets a little special attention
bool isArrayOp;
// true if overridden with the pragma(allow_inline); stmt
bool allowInlining;
};
struct FuncAliasDeclaration : FuncDeclaration

View File

@@ -80,6 +80,7 @@ FuncDeclaration::FuncDeclaration(Loc loc, Loc endloc, Identifier *id, enum STC s
// LDC
isArrayOp = false;
allowInlining = false;
}
Dsymbol *FuncDeclaration::syntaxCopy(Dsymbol *s)

View File

@@ -240,6 +240,7 @@ Msgtable msgtable[] =
{ "vaend", "va_end" },
{ "vaarg", "va_arg" },
{ "ldc" },
{ "allow_inline" },
// For special functions
{ "tohash", "toHash" },

View File

@@ -2197,6 +2197,13 @@ Statement *IfStatement::semantic(Scope *sc)
condition = new AssignExp(loc, v, condition);
condition = condition->semantic(scd);
}
// LDC
else if (ident == Id::allow_inline)
{
sc->func->allowInlining = true;
}
else
scd = sc->push();
ifbody = ifbody->semantic(scd);

View File

@@ -162,15 +162,16 @@ struct Statement : Object
// Back end
virtual void toIR(IRState *irs);
// LDC
virtual void toNakedIR(IRState *irs);
// Avoid dynamic_cast
virtual DeclarationStatement *isDeclarationStatement() { return NULL; }
virtual CompoundStatement *isCompoundStatement() { return NULL; }
virtual ReturnStatement *isReturnStatement() { return NULL; }
virtual IfStatement *isIfStatement() { return NULL; }
virtual CaseStatement* isCaseStatement() { return NULL; }
// LDC
virtual void toNakedIR(IRState *irs);
virtual AsmBlockStatement* endsWithAsm();
};
struct ExpStatement : Statement
@@ -245,6 +246,7 @@ struct CompoundStatement : Statement
// LDC
virtual void toNakedIR(IRState *irs);
virtual AsmBlockStatement* endsWithAsm();
virtual CompoundStatement *isCompoundStatement() { return this; }
};
@@ -941,6 +943,9 @@ struct AsmBlockStatement : CompoundStatement
void toIR(IRState *irs);
virtual void toNakedIR(IRState *irs);
AsmBlockStatement* endsWithAsm();
llvm::Value* abiret;
};
#endif /* DMD_STATEMENT_H */