Support of *-generic-16 target

This commit is contained in:
Vsevolod Livinskiy
2015-04-17 11:20:39 +03:00
parent 1d40f0a930
commit c2039da7b8
4 changed files with 98 additions and 23 deletions

View File

@@ -515,8 +515,14 @@ Function::GenerateIR() {
llvm::FunctionType *ftype = type->LLVMFunctionType(g->ctx, true);
llvm::GlobalValue::LinkageTypes linkage = llvm::GlobalValue::ExternalLinkage;
std::string functionName = sym->name;
if (g->mangleFunctionsWithTarget)
functionName += std::string("_") + g->target->GetISAString();
if (g->mangleFunctionsWithTarget) {
// If we treat generic as smth, we should have appropriate mangling
if (g->target->getISA() == Target::GENERIC &&
!g->target->getTreatGenericAsSmth().empty())
functionName += std::string("_") + g->target->getTreatGenericAsSmth();
else
functionName += std::string("_") + g->target->GetISAString();
}
#ifdef ISPC_NVPTX_ENABLED
if (g->target->getISA() == Target::NVPTX)
{