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

Method NodeDereference

NULLC/SyntaxTree.cpp:1014–1049  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1012// Node to get value by address (dereference pointer)
1013
1014NodeDereference::NodeDereference(FunctionInfo* setClosure, unsigned int offsetToPrevClosure, bool isReadonly)
1015{
1016 originalNode = first = TakeLastNode();
1017 assert(first->typeInfo);
1018 assert(first->typeInfo->subType);
1019 typeInfo = first->typeInfo->subType;
1020
1021 absAddress = true;
1022 knownAddress = false;
1023 addrShift = 0;
1024 closureFunc = setClosure;
1025 offsetToPreviousClosure = offsetToPrevClosure;
1026 neutralized = false;
1027 readonly = isReadonly;
1028
1029#ifndef NULLC_ENABLE_C_TRANSLATION
1030 if(first->nodeType == typeNodeGetAddress && !static_cast<NodeGetAddress*>(first)->trackAddress)
1031 {
1032 absAddress = static_cast<NodeGetAddress*>(first)->IsAbsoluteAddress();
1033 addrShift = static_cast<NodeGetAddress*>(first)->varAddress;
1034 knownAddress = true;
1035 }
1036 if(first->nodeType == typeNodeShiftAddress)
1037 {
1038 addrShift = static_cast<NodeShiftAddress*>(first)->memberShift;
1039 first = static_cast<NodeShiftAddress*>(first)->first;
1040 }
1041 if(first->nodeType == typeNodeArrayIndex && static_cast<NodeArrayIndex*>(first)->knownShift)
1042 {
1043 addrShift = static_cast<NodeArrayIndex*>(first)->shiftValue;
1044 first = static_cast<NodeArrayIndex*>(first)->first;
1045 }
1046#endif
1047
1048 nodeType = typeNodeDereference;
1049}
1050
1051NodeDereference::~NodeDereference()
1052{

Callers

nothing calls this directly

Calls 3

TakeLastNodeFunction · 0.85
assertFunction · 0.85
IsAbsoluteAddressMethod · 0.80

Tested by

no test coverage detected