当前位置: 首页>>代码示例>>C++>>正文


C++ SValuePtr::get_width方法代码示例

本文整理汇总了C++中SValuePtr::get_width方法的典型用法代码示例。如果您正苦于以下问题:C++ SValuePtr::get_width方法的具体用法?C++ SValuePtr::get_width怎么用?C++ SValuePtr::get_width使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SValuePtr的用法示例。


在下文中一共展示了SValuePtr::get_width方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: undefined_

BaseSemantics::SValuePtr
RiscOperators::concat(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_)
{
    SValuePtr a = SValue::promote(a_);
    SValuePtr b = SValue::promote(b_);
    return undefined_(a->get_width() + b->get_width());
}
开发者ID:lvpw,项目名称:edg4x-rose,代码行数:7,代码来源:NullSemantics2.C

示例2: if

Sawyer::Optional<BaseSemantics::SValuePtr>
SValue::createOptionalMerge(const BaseSemantics::SValuePtr &other_, const BaseSemantics::MergerPtr &merger,
                            const SmtSolverPtr &solver) const {
    SValuePtr other = SValue::promote(other_);
    SValuePtr retval = create_empty(other->get_width());
    bool changed = false;
    for (size_t i=0; i<subvalues.size(); ++i) {
        BaseSemantics::SValuePtr thisValue = subvalues[i];
        BaseSemantics::SValuePtr otherValue = other->subvalues[i];
        if (otherValue) {
            if (thisValue==NULL) {
                retval->subvalues.push_back(otherValue);
                changed = true;
            } else if (BaseSemantics::SValuePtr mergedValue =
                       thisValue->createOptionalMerge(otherValue, merger, solver).orDefault()) {
                changed = true;
                retval->subvalues.push_back(mergedValue);
            } else {
                retval->subvalues.push_back(thisValue);
            }
        } else {
            retval->subvalues.push_back(thisValue);
        }
    }
    return changed ? Sawyer::Optional<BaseSemantics::SValuePtr>(retval) : Sawyer::Nothing();
}
开发者ID:matzke1,项目名称:rose-develop,代码行数:26,代码来源:MultiSemantics2.C

示例3:

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;
}
开发者ID:alexjohn1362,项目名称:rose,代码行数:18,代码来源:SymbolicMemory2.C


注:本文中的SValuePtr::get_width方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。