Added pragma extractelement

This commit is contained in:
Jernej Krempuš
2012-10-02 21:37:27 +02:00
parent d5d649b9c9
commit 2cf5d8c2a0
4 changed files with 38 additions and 1 deletions

View File

@@ -116,6 +116,17 @@ Pragma DtoGetPragma(Scope *sc, PragmaDeclaration *decl, std::string &arg1str)
return LLVMshufflevector;
}
// pragma(extractelement) { funcdecl(s) }
else if (ident == Id::Extractelement)
{
if (args && args->dim > 0)
{
error("takes no parameters");
fatal();
}
return LLVMextractelement;
}
// pragma(va_start) { templdecl(s) }
else if (ident == Id::vastart)
{
@@ -375,6 +386,18 @@ void DtoCheckPragma(PragmaDeclaration *decl, Dsymbol *s,
}
break;
case LLVMextractelement:
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())
{