MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / remove_node

Method remove_node

lib/asmjit/asmjit/core/builder.cpp:235–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235BaseNode* BaseBuilder::remove_node(BaseNode* node) noexcept {
236 if (!node->is_active()) {
237 return node;
238 }
239
240 BaseNode* prev = node->prev();
241 BaseNode* next = node->next();
242
243 if (_node_list._first == node) {
244 _node_list._first = next;
245 }
246 else {
247 prev->_next = next;
248 }
249
250 if (_node_list._last == node) {
251 _node_list._last = prev;
252 }
253 else {
254 next->_prev = prev;
255 }
256
257 node->_prev = nullptr;
258 node->_next = nullptr;
259 node->_clear_flags(NodeFlags::kIsActive);
260
261 if (node->is_section()) {
262 _dirty_section_links = true;
263 }
264
265 if (_cursor == node) {
266 _cursor = prev;
267 }
268
269 return node;
270}
271
272void BaseBuilder::remove_nodes(BaseNode* first, BaseNode* last) noexcept {
273 if (first == last) {

Callers 4

remove_nodeFunction · 0.80
rewriteMethod · 0.80
rewriteMethod · 0.80

Calls 5

is_activeMethod · 0.80
prevMethod · 0.80
_clear_flagsMethod · 0.80
is_sectionMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected