mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-26 17:43:14 +01:00
[svn r253] Removed -inlineasm option. inline asm is now enabled by default unless the new -noasm option is passed.
Tried adding a stack trace print when compiler crashes, not sure it's working though. Changed data layouts to match that of llvm-gcc. Fixed casting function pointers. Added support checks in AsmStatement.
This commit is contained in:
@@ -198,7 +198,20 @@ bool d_have_inline_asm() { return true; }
|
||||
|
||||
Statement *AsmStatement::semantic(Scope *sc)
|
||||
{
|
||||
|
||||
bool err = false;
|
||||
if (global.params.cpu != ARCHx86)
|
||||
{
|
||||
error("inline asm is not supported for the \"%s\" architecture", global.params.llvmArch);
|
||||
err = true;
|
||||
}
|
||||
if (!global.params.useInlineAsm)
|
||||
{
|
||||
error("inline asm is not allowed when the -noasm switch is used");
|
||||
err = true;
|
||||
}
|
||||
if (err)
|
||||
fatal();
|
||||
|
||||
sc->func->inlineAsm = 1;
|
||||
sc->func->inlineStatus = ILSno; // %% not sure
|
||||
// %% need to set DECL_UNINLINABLE too?
|
||||
@@ -262,8 +275,6 @@ AsmStatement::toIR(IRState * irs)
|
||||
LLValue* arg_val = 0;
|
||||
std::string cns;
|
||||
|
||||
std::cout << std::endl;
|
||||
|
||||
switch (arg->type) {
|
||||
case Arg_Integer:
|
||||
arg_val = arg->expr->toElem(irs)->getRVal();
|
||||
@@ -379,7 +390,7 @@ assert(0);
|
||||
++p;
|
||||
}
|
||||
|
||||
printf("final: %.*s\n", code->insnTemplateLen, code->insnTemplate);
|
||||
Logger::println("final asm: %.*s", code->insnTemplateLen, code->insnTemplate);
|
||||
|
||||
std::string insnt(code->insnTemplate, code->insnTemplateLen);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user