MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / leaveFunction

Method leaveFunction

SPIRV/SpvBuilder.cpp:2916–2939  ·  view source on GitHub ↗

Comments in header

Source from the content-addressed store, hash-verified

2914
2915// Comments in header
2916void Builder::leaveFunction()
2917{
2918 Block* block = buildPoint;
2919 Function& function = buildPoint->getParent();
2920 assert(block);
2921
2922 // If our function did not contain a return, add a return void now.
2923 if (! block->isTerminated()) {
2924 if (function.getReturnType() == makeVoidType())
2925 makeReturn(true);
2926 else {
2927 makeReturn(true, createUndefined(function.getReturnType()));
2928 }
2929 }
2930
2931 // Clear function scope from debug scope stack
2932 if (emitNonSemanticShaderDebugInfo)
2933 currentDebugScopeId.pop();
2934
2935 emitNonSemanticShaderDebugInfo = restoreNonSemanticShaderDebugInfo;
2936
2937 // Clear current function record
2938 currentFunction = nullptr;
2939}
2940
2941// Comments in header
2942void Builder::makeStatementTerminator(spv::Op opcode, const char *name)

Callers 2

finishSpvMethod · 0.80
visitAggregateMethod · 0.80

Calls 3

isTerminatedMethod · 0.80
getReturnTypeMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected