本文整理汇总了C++中SValuePtr::copy方法的典型用法代码示例。如果您正苦于以下问题:C++ SValuePtr::copy方法的具体用法?C++ SValuePtr::copy怎么用?C++ SValuePtr::copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SValuePtr
的用法示例。
在下文中一共展示了SValuePtr::copy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
SValuePtr
SymbolicMemory::readMemory(const SValuePtr &address_, const SValuePtr &dflt, RiscOperators *addrOps, RiscOperators *valOps) {
using namespace InsnSemanticsExpr;
SymbolicSemantics::SValuePtr address = SymbolicSemantics::SValue::promote(address_);
if (address->get_width() != mem_->domainWidth() || dflt->get_width() != mem_->get_nbits()) {
ASSERT_require2(mem_->isLeafNode() && mem_->isLeafNode()->is_memory(),
"invalid address and/or value size for memory; expecting " +
StringUtility::numberToString(mem_->domainWidth()) + "-bit addresses and " +
StringUtility::numberToString(mem_->get_nbits()) + "-bit values");
// We can finalize the domain and range widths for the memory now that they've been given.
mem_ = LeafNode::create_memory(address->get_width(), dflt->get_width());
}
TreeNodePtr resultExpr = InternalNode::create(8, OP_READ, mem_, address->get_expression());
SymbolicSemantics::SValuePtr retval = SymbolicSemantics::SValue::promote(dflt->copy());
retval->set_expression(resultExpr);
return retval;
}