Merge pull request #1024 from Vsevolod-Livinskij/multitarget

Support of *-generic-16 target
This commit is contained in:
Dmitry Babokin
2015-04-24 18:16:45 +03:00
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)
{