| 1145 | // Node for increment and decrement operations |
| 1146 | |
| 1147 | NodePreOrPostOp::NodePreOrPostOp(bool isInc, bool preOp) |
| 1148 | { |
| 1149 | first = TakeLastNode(); |
| 1150 | assert(first->typeInfo->refLevel != 0); |
| 1151 | typeInfo = first->typeInfo->subType; |
| 1152 | |
| 1153 | incOp = isInc; |
| 1154 | |
| 1155 | if(typeInfo->type == TypeInfo::TYPE_COMPLEX || typeInfo->refLevel != 0) |
| 1156 | ThrowError(CodeInfo::lastKnownStartPos, "ERROR: %s is not supported on '%s'", (isInc ? "increment" : "decrement"), typeInfo->GetFullTypeName()); |
| 1157 | |
| 1158 | prefixOp = preOp; |
| 1159 | |
| 1160 | optimised = false; |
| 1161 | |
| 1162 | absAddress = true; |
| 1163 | knownAddress = false; |
| 1164 | addrShift = 0; |
| 1165 | |
| 1166 | #ifndef NULLC_ENABLE_C_TRANSLATION |
| 1167 | if(first->nodeType == typeNodeGetAddress) |
| 1168 | { |
| 1169 | absAddress = static_cast<NodeGetAddress*>(first)->IsAbsoluteAddress(); |
| 1170 | addrShift = static_cast<NodeGetAddress*>(first)->varAddress; |
| 1171 | knownAddress = true; |
| 1172 | } |
| 1173 | if(first->nodeType == typeNodeShiftAddress) |
| 1174 | { |
| 1175 | addrShift = static_cast<NodeShiftAddress*>(first)->memberShift; |
| 1176 | first = static_cast<NodeShiftAddress*>(first)->first; |
| 1177 | } |
| 1178 | if(first->nodeType == typeNodeArrayIndex && static_cast<NodeArrayIndex*>(first)->knownShift) |
| 1179 | { |
| 1180 | addrShift = static_cast<NodeArrayIndex*>(first)->shiftValue; |
| 1181 | first = static_cast<NodeArrayIndex*>(first)->first; |
| 1182 | } |
| 1183 | #endif |
| 1184 | |
| 1185 | nodeType = typeNodePreOrPostOp; |
| 1186 | } |
| 1187 | |
| 1188 | NodePreOrPostOp::~NodePreOrPostOp() |
| 1189 | { |
nothing calls this directly
no test coverage detected