2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
7 #include "PointerToMemberValueNode.h"
11 #include "Architecture.h"
12 #include "IntegerValue.h"
15 #include "ValueLoader.h"
16 #include "ValueLocation.h"
19 PointerToMemberValueNode::PointerToMemberValueNode(ValueNodeChild
* nodeChild
,
20 PointerToMemberType
* type
)
22 ChildlessValueNode(nodeChild
),
25 fType
->AcquireReference();
29 PointerToMemberValueNode::~PointerToMemberValueNode()
31 fType
->ReleaseReference();
36 PointerToMemberValueNode::GetType() const
43 PointerToMemberValueNode::ResolvedLocationAndValue(ValueLoader
* valueLoader
,
44 ValueLocation
*& _location
, Value
*& _value
)
47 ValueLocation
* location
= NodeChild()->Location();
51 TRACE_LOCALS(" TYPE_POINTER_TO_MEMBER\n");
55 if (valueLoader
->GetArchitecture()->AddressSize() == 4) {
56 valueType
= B_UINT32_TYPE
;
57 TRACE_LOCALS(" -> 32 bit\n");
59 valueType
= B_UINT64_TYPE
;
60 TRACE_LOCALS(" -> 64 bit\n");
63 // load the value data
65 status_t error
= valueLoader
->LoadValue(location
, valueType
, false,
70 // create the type object
71 Value
* value
= new(std::nothrow
) IntegerValue(valueData
);
75 location
->AcquireReference();