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


C++ TIntermAggregate::setOp方法代码示例

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


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

示例1: TIntermAggregate

//
// This is the safe way to change the operator on an aggregate, as it
// does lots of error checking and fixing.  Especially for establishing
// a function call's operation on it's set of parameters.  Sequences
// of instructions are also aggregates, but they just direnctly set
// their operator to EOpSequence.
//
// Returns an aggregate node, which could be the one passed in if
// it was already an aggregate but no operator was set.
//
TIntermAggregate *TIntermediate::setAggregateOperator(
    TIntermNode *node, TOperator op, const TSourceLoc &line)
{
    TIntermAggregate *aggNode;

    //
    // Make sure we have an aggregate.  If not turn it into one.
    //
    if (node)
    {
        aggNode = node->getAsAggregate();
        if (aggNode == NULL || aggNode->getOp() != EOpNull)
        {
            //
            // Make an aggregate containing this node.
            //
            aggNode = new TIntermAggregate();
            aggNode->getSequence()->push_back(node);
        }
    }
    else
    {
        aggNode = new TIntermAggregate();
    }

    //
    // Set the operator.
    //
    aggNode->setOp(op);
    aggNode->setLine(line);

    return aggNode;
}
开发者ID:AOSC-Dev,项目名称:Pale-Moon,代码行数:43,代码来源:Intermediate.cpp

示例2: makeAggregate

// If the input node is nullptr, return nullptr.
// If the input node is a sequence (block) node, return it.
// If the input node is not a sequence node, put it inside a sequence node and return that.
TIntermAggregate *TIntermediate::ensureSequence(TIntermNode *node)
{
    if (node == nullptr)
        return nullptr;
    TIntermAggregate *aggNode = node->getAsAggregate();
    if (aggNode != nullptr && aggNode->getOp() == EOpSequence)
        return aggNode;

    aggNode = makeAggregate(node, node->getLine());
    aggNode->setOp(EOpSequence);
    return aggNode;
}
开发者ID:kizmo,项目名称:angle,代码行数:15,代码来源:Intermediate.cpp

示例3: postProcess

//
// This is to be executed once the final root is put on top by the parsing
// process.
//
bool TIntermediate::postProcess(TIntermNode *root)
{
    if (root == NULL)
        return true;

    //
    // First, finish off the top level sequence, if any
    //
    TIntermAggregate *aggRoot = root->getAsAggregate();
    if (aggRoot && aggRoot->getOp() == EOpNull)
        aggRoot->setOp(EOpSequence);

    return true;
}
开发者ID:AOSC-Dev,项目名称:Pale-Moon,代码行数:18,代码来源:Intermediate.cpp

示例4: if

//
// This is to be executed once the final root is put on top by the parsing
// process.
//
TIntermAggregate *TIntermediate::postProcess(TIntermNode *root)
{
    if (root == nullptr)
        return nullptr;

    //
    // Finish off the top level sequence, if any
    //
    TIntermAggregate *aggRoot = root->getAsAggregate();
    if (aggRoot != nullptr && aggRoot->getOp() == EOpNull)
    {
        aggRoot->setOp(EOpSequence);
    }
    else if (aggRoot == nullptr || aggRoot->getOp() != EOpSequence)
    {
        aggRoot = new TIntermAggregate(EOpSequence);
        aggRoot->setLine(root->getLine());
        aggRoot->getSequence()->push_back(root);
    }

    return aggRoot;
}
开发者ID:70599,项目名称:Waterfox,代码行数:26,代码来源:Intermediate.cpp


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