Comments in header
| 2695 | |
| 2696 | // Comments in header |
| 2697 | Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const char* name, LinkageType linkType, |
| 2698 | const std::vector<Id>& paramTypes, |
| 2699 | const std::vector<std::vector<Decoration>>& decorations, Block** entry) |
| 2700 | { |
| 2701 | // Make the function and initial instructions in it |
| 2702 | Id typeId = makeFunctionType(returnType, paramTypes); |
| 2703 | Id firstParamId = paramTypes.size() == 0 ? 0 : getUniqueIds((int)paramTypes.size()); |
| 2704 | Id funcId = getUniqueId(); |
| 2705 | Function* function = new Function(funcId, returnType, typeId, firstParamId, linkType, name, module); |
| 2706 | |
| 2707 | // Set up the precisions |
| 2708 | setPrecision(function->getId(), precision); |
| 2709 | function->setReturnPrecision(precision); |
| 2710 | for (unsigned p = 0; p < (unsigned)decorations.size(); ++p) { |
| 2711 | for (int d = 0; d < (int)decorations[p].size(); ++d) { |
| 2712 | addDecoration(firstParamId + p, decorations[p][d]); |
| 2713 | function->addParamPrecision(p, decorations[p][d]); |
| 2714 | } |
| 2715 | } |
| 2716 | |
| 2717 | // reset last debug scope |
| 2718 | if (emitNonSemanticShaderDebugInfo) { |
| 2719 | dirtyScopeTracker = true; |
| 2720 | } |
| 2721 | |
| 2722 | // CFG |
| 2723 | assert(entry != nullptr); |
| 2724 | *entry = new Block(getUniqueId(), *function); |
| 2725 | function->addBlock(*entry); |
| 2726 | setBuildPoint(*entry); |
| 2727 | |
| 2728 | if (name) |
| 2729 | addName(function->getId(), name); |
| 2730 | |
| 2731 | functions.push_back(std::unique_ptr<Function>(function)); |
| 2732 | |
| 2733 | return function; |
| 2734 | } |
| 2735 | |
| 2736 | void Builder::setupFunctionDebugInfo(Function* function, const char* name, const std::vector<Id>& paramTypes, |
| 2737 | const std::vector<char const*>& paramNames) |
no test coverage detected