added now NVPTX64 automatically emits unmasked extern "C" for task function with kernel attributes

This commit is contained in:
Evghenii
2013-10-28 13:58:01 +01:00
parent a7aa1ac1cf
commit 1bd5360d3b
4 changed files with 13 additions and 8 deletions

View File

@@ -530,16 +530,22 @@ Declarator::InitFromType(const Type *baseType, DeclSpecs *ds) {
returnType = returnType->ResolveUnboundVariability(Variability::Varying);
bool isTask = ds && ((ds->typeQualifiers & TYPEQUAL_TASK) != 0);
if (isTask && g->target->getISA() == Target::NVPTX64)
{
ds->storageClass = SC_EXTERN_C;
ds->typeQualifiers |= TYPEQUAL_UNMASKED;
}
bool isExternC = ds && (ds->storageClass == SC_EXTERN_C);
bool isExported = ds && ((ds->typeQualifiers & TYPEQUAL_EXPORT) != 0);
bool isTask = ds && ((ds->typeQualifiers & TYPEQUAL_TASK) != 0);
bool isUnmasked = ds && ((ds->typeQualifiers & TYPEQUAL_UNMASKED) != 0);
if (isExported && isTask) {
Error(pos, "Function can't have both \"task\" and \"export\" "
"qualifiers");
return;
}j
}
#if 0 /* NVPTX64::task_and_externC */
if (isExternC && isTask) {
Error(pos, "Function can't have both \"extern \"C\"\" and \"task\" "