MCPcopy Create free account
hub / github.com/dfranx/ShaderDebugger / translateIfStatement

Method translateIfStatement

src/HLSLCompiler.cpp:1227–1239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1225 m_gen.Function.SetAddress(m_gen.Function.Goto(), m_continueAddr.top());
1226 }
1227 void HLSLCompiler::translateIfStatement(M4::HLSLIfStatement* ifStmt)
1228 {
1229 translateExpression(ifStmt->condition);
1230 size_t pos = m_gen.Function.If();
1231 translateStatements(ifStmt->statement);
1232 size_t goto_ref = m_gen.Function.Goto();
1233 m_gen.Function.SetAddress(pos, m_gen.Function.GetCurrentAddress());
1234
1235 if (ifStmt->elseStatement)
1236 translateStatements(ifStmt->elseStatement);
1237
1238 m_gen.Function.SetAddress(goto_ref, m_gen.Function.GetCurrentAddress());
1239 }
1240 void HLSLCompiler::translateForStatement(M4::HLSLForStatement* forStmt)
1241 {
1242 m_breaks.push(std::vector<size_t>());

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected