Added pragma shufflevector.

This commit is contained in:
Jernej Krempuš
2012-08-05 18:51:49 +02:00
parent 3d108ee684
commit 100907ffa2
4 changed files with 46 additions and 1 deletions

View File

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