| 174 | } |
| 175 | |
| 176 | CBSentinel* CodeCompiler::endFunc() { |
| 177 | CCFunc* func = getFunc(); |
| 178 | if (!func) { |
| 179 | // TODO: |
| 180 | return nullptr; |
| 181 | } |
| 182 | |
| 183 | // Add the local constant pool at the end of the function (if exists). |
| 184 | if (_localConstPool) { |
| 185 | setCursor(func->getEnd()->getPrev()); |
| 186 | addNode(_localConstPool); |
| 187 | _localConstPool = nullptr; |
| 188 | } |
| 189 | |
| 190 | // Mark as finished. |
| 191 | func->_isFinished = true; |
| 192 | _func = nullptr; |
| 193 | |
| 194 | CBSentinel* end = func->getEnd(); |
| 195 | setCursor(end); |
| 196 | return end; |
| 197 | } |
| 198 | |
| 199 | // ============================================================================ |
| 200 | // [asmjit::CodeCompiler - Ret] |