Added pragma insertelement.

This commit is contained in:
Jernej Krempuš
2012-10-02 22:22:53 +02:00
parent 2cf5d8c2a0
commit b798974f3a
4 changed files with 40 additions and 1 deletions

View File

@@ -127,6 +127,17 @@ Pragma DtoGetPragma(Scope *sc, PragmaDeclaration *decl, std::string &arg1str)
return LLVMextractelement;
}
// pragma(insertelement) { funcdecl(s) }
else if (ident == Id::Insertelement)
{
if (args && args->dim > 0)
{
error("takes no parameters");
fatal();
}
return LLVMinsertelement;
}
// pragma(va_start) { templdecl(s) }
else if (ident == Id::vastart)
{
@@ -398,6 +409,18 @@ void DtoCheckPragma(PragmaDeclaration *decl, Dsymbol *s,
}
break;
case LLVMinsertelement:
if (FuncDeclaration* fd = s->isFuncDeclaration())
{
fd->llvmInternal = llvm_internal;
}
else
{
error("the '%s' pragma must only be used on function declarations.", ident->toChars());
fatal();
}
break;
case LLVMinline_asm:
if (TemplateDeclaration* td = s->isTemplateDeclaration())
{