MCPcopy Create free account
hub / github.com/WheretIB/nullc / AddUnaryModifyOpNode

Function AddUnaryModifyOpNode

NULLC/Callbacks.cpp:2126–2143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2124}
2125
2126void AddUnaryModifyOpNode(const char* pos, bool isInc, bool prefixOp)
2127{
2128 NodeZeroOP *pointer = CodeInfo::nodeList.back();
2129 CheckForImmutable(pointer->typeInfo, pos);
2130
2131 // For indexes that aren't known at compile-time
2132 if(pointer->nodeType == typeNodeArrayIndex && !((NodeArrayIndex*)pointer)->knownShift)
2133 {
2134 // Create variable that will hold calculated pointer
2135 AddInplaceVariable(pos);
2136 // Get pointer from it
2137 CodeInfo::nodeList.push_back(new NodeDereference());
2138 CodeInfo::nodeList.push_back(new NodePreOrPostOp(isInc, prefixOp));
2139 AddExtraNode();
2140 }else{
2141 CodeInfo::nodeList.push_back(new NodePreOrPostOp(isInc, prefixOp));
2142 }
2143}
2144
2145void AddModifyVariableNode(const char* pos, CmdID cmd, const char* name)
2146{

Callers 4

AddArrayIteratorFunction · 0.85
AddListGeneratorFunction · 0.85
ParseGroupFunction · 0.85
ParseTerminalFunction · 0.85

Calls 4

CheckForImmutableFunction · 0.85
AddInplaceVariableFunction · 0.85
AddExtraNodeFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected