Lines Matching defs:function
634 // If compiling HLSL, glslang will create a wrapper function around the entrypoint. Accordingly, a void(void)
635 // function type is created for the wrapper function. However, nonsemantic shader debug information is disabled
636 // while creating the HLSL wrapper. Consequently, if we encounter another void(void) function, we need to create
637 // the associated debug function type if it hasn't been created yet.
1840 Instruction* Builder::addEntryPoint(ExecutionModel model, Function* function, const char* name)
1844 entryPoint->addIdOperand(function->getId());
2098 // Make the function and initial instructions in it
2102 Function* function = new Function(funcId, returnType, typeId, firstParamId, linkType, name, module);
2105 setPrecision(function->getId(), precision);
2106 function->setReturnPrecision(precision);
2110 function->addParamPrecision(p, decorations[p][d]);
2121 *entry = new Block(getUniqueId(), *function);
2122 function->addBlock(*entry);
2126 addName(function->getId(), name);
2128 functions.push_back(std::unique_ptr<Function>(function));
2130 return function;
2133 void Builder::setupDebugFunctionEntry(Function* function, const char* name, int line, const std::vector<Id>& paramTypes,
2142 Id funcTypeId = function->getFuncTypeId();
2144 Id funcId = function->getId();
2148 // Make the debug function instruction
2149 Id debugFuncId = makeDebugFunction(function, nameId, funcTypeId);
2158 Id firstParamId = function->getParamId(0);
2188 Id Builder::makeDebugFunction([[maybe_unused]] Function* function, Id nameId, Id funcTypeId)
2190 assert(function != nullptr);
2272 void Builder::enterFunction(Function const* function)
2274 // Save and disable debugInfo for HLSL entry point function. It is a wrapper
2275 // function with no user code in it.
2277 if (sourceLang == spv::SourceLanguageHLSL && function == entryPointFunction) {
2283 Id funcId = function->getFuncId();
2295 if (auto linkType = function->getLinkType(); linkType != LinkageTypeMax) {
2296 Id funcId = function->getFuncId();
2298 addLinkageDecoration(funcId, function->getExportName(), linkType);
2306 Function& function = buildPoint->getParent();
2309 // If our function did not contain a return, add a return void now.
2311 if (function.getReturnType() == makeVoidType())
2314 makeReturn(true, createUndefined(function.getReturnType()));
2318 // Clear function scope from debug scope stack
2755 Id Builder::createFunctionCall(spv::Function* function, const std::vector<spv::Id>& args)
2757 Instruction* op = new Instruction(getUniqueId(), function->getReturnType(), OpFunctionCall);
2758 op->addIdOperand(function->getId());
3471 function = &builder.getBuildPoint()->getParent();
3473 // make the blocks, but only put the then-block into the function,
3476 thenBlock = new Block(builder.getUniqueId(), *function);
3477 mergeBlock = new Block(builder.getUniqueId(), *function);
3483 function->addBlock(thenBlock);
3493 // Make the first else block and add it to the function
3494 elseBlock = new Block(builder.getUniqueId(), *function);
3495 function->addBlock(elseBlock);
3515 // add the merge block to the function
3516 function->addBlock(mergeBlock);
3525 Function& function = buildPoint->getParent();
3529 segmentBlocks.push_back(new Block(getUniqueId(), function));
3531 Block* mergeBlock = new Block(getUniqueId(), function);
3590 Function& function = buildPoint->getParent();
3591 auto block = new Block(getUniqueId(), function);
3592 function.addBlock(block);
3762 // make a new function variable for this r-value, using an initializer,