本文整理汇总了C++中UlamValue::checkForAbsolutePtr方法的典型用法代码示例。如果您正苦于以下问题:C++ UlamValue::checkForAbsolutePtr方法的具体用法?C++ UlamValue::checkForAbsolutePtr怎么用?C++ UlamValue::checkForAbsolutePtr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UlamValue
的用法示例。
在下文中一共展示了UlamValue::checkForAbsolutePtr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeUlamValuePtr
// (from NodeIdent's makeUlamValuePtr)
// return ptr to this data member within the m_currentObjPtr
// 'pos' modified by this data member symbol's packed bit position
UlamValue NodeVarRef::makeUlamValuePtr()
{
u32 pos = 0;
if(m_varSymbol->isDataMember())
pos = m_varSymbol->getPosOffset();
UlamValue ptr = UlamValue::makePtr(m_state.m_currentObjPtr.getPtrSlotIndex(), m_state.m_currentObjPtr.getPtrStorage(), getNodeType(), m_state.determinePackable(getNodeType()), m_state, m_state.m_currentObjPtr.getPtrPos() + pos, m_varSymbol->getId());
ptr.checkForAbsolutePtr(m_state.m_currentObjPtr);
return ptr;
} //makeUlamValuePtr
示例2: makeUlamValuePtr
UlamValue NodeAtomof::makeUlamValuePtr()
{
// (from NodeVarDecl's makeUlamValuePtr)
UlamValue ptr;
UlamValue atomuv;
UTI auti = getOfType();
assert(m_nodeOf);
if(m_nodeOf->hasASymbolSelf())
{
//when "self/atom" is a quark, we're inside a func called on a quark (e.g. dm or local)
//'atom' gets entire atom/element containing this quark; including its type!
//'self' gets type/pos/len of the quark from which 'atom' can be extracted
UlamValue selfuvp = m_state.m_currentSelfPtr;
UTI ttype = selfuvp.getPtrTargetType();
assert(m_state.okUTItoContinue(ttype));
if((m_state.getUlamTypeByIndex(ttype)->getUlamClassType() == UC_QUARK))
{
selfuvp = atomuv; //bail for error
}
return selfuvp;
} //done
if(m_state.getReferenceType(auti) == ALT_AS)
{
assert(0);
Symbol * vsym = NULL;
m_nodeOf->getSymbolPtr(vsym);
return ((SymbolVariableStack *) vsym)->getAutoPtrForEval(); //haha! we're done.
}
if(m_nodeOf->hasASymbolDataMember())
{
UTI cuti = m_state.m_currentObjPtr.getPtrTargetType();
UlamType * cut = m_state.getUlamTypeByIndex(cuti);
if(cut->getUlamClassType() == UC_QUARK)
ptr = atomuv; //bail
else
{
// return ptr to the m_currentObjPtr that contains this data member within
ptr = UlamValue::makePtr(m_state.m_currentObjPtr.getPtrSlotIndex(), m_state.m_currentObjPtr.getPtrStorage(), auti, m_state.determinePackable(getNodeType()), m_state, 0, 0); //id?
ptr.checkForAbsolutePtr(m_state.m_currentObjPtr);
}
}
else
{
UTI vuti = getOfType();
UlamType * vut = m_state.getUlamTypeByIndex(vuti);
if(vut->getUlamClassType() == UC_QUARK)
ptr = atomuv; //bail
else
{
//local variable on the stack; could be array ptr!
Symbol * vsym = NULL;
m_nodeOf->getSymbolPtr(vsym);
ptr = UlamValue::makePtr(((SymbolVariableStack *) vsym)->getStackFrameSlotIndex(), STACK, auti, m_state.determinePackable(vuti), m_state, 0, vsym->getId()); //id?
}
}
return ptr;
} //makeUlamValuePtr