亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? support_iter.c

?? cg編譯器
?? C
字號:
/****************************************************************************\
Copyright (c) 2002, NVIDIA Corporation.

NVIDIA Corporation("NVIDIA") supplies this software to you in
consideration of your agreement to the following terms, and your use,
installation, modification or redistribution of this NVIDIA software
constitutes acceptance of these terms.  If you do not agree with these
terms, please do not use, install, modify or redistribute this NVIDIA
software.

In consideration of your agreement to abide by the following terms, and
subject to these terms, NVIDIA grants you a personal, non-exclusive
license, under NVIDIA's copyrights in this original NVIDIA software (the
"NVIDIA Software"), to use, reproduce, modify and redistribute the
NVIDIA Software, with or without modifications, in source and/or binary
forms; provided that if you redistribute the NVIDIA Software, you must
retain the copyright notice of NVIDIA, this notice and the following
text and disclaimers in all such redistributions of the NVIDIA Software.
Neither the name, trademarks, service marks nor logos of NVIDIA
Corporation may be used to endorse or promote products derived from the
NVIDIA Software without specific prior written permission from NVIDIA.
Except as expressly stated in this notice, no other rights or licenses
express or implied, are granted by NVIDIA herein, including but not
limited to any patent rights that may be infringed by your derivative
works or by other works in which the NVIDIA Software may be
incorporated. No hardware is licensed hereunder. 

THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
PRODUCTS.

IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\****************************************************************************/
// support_iter.c
//
// Routines to iterate over the expr/stmt graph
//

#include <assert.h>
#include <stdlib.h>
#include <stdio.h>

#include "slglobals.h"

/*
 * ApplyToNodes() - Walk an expression tree and apply "pre" and "post" to
 * each node.  pre is applied in prefix order, and post in postfix
 *
 */
expr *ApplyToNodes(expr *(*pre)(expr *, void *, int),
                   expr *(*post)(expr *, void *, int),
                   expr *fExpr, void *arg1, int arg2)
{
    if (fExpr) {
        if (pre) fExpr = pre(fExpr, arg1, arg2);
        switch (fExpr->common.kind) {
        case DECL_N:
        case SYMB_N:
        case CONST_N:
            break;
        case UNARY_N:
            fExpr->un.arg = ApplyToNodes(pre, post, fExpr->un.arg, arg1, arg2);
            break;
        case BINARY_N:
            fExpr->bin.left = ApplyToNodes(pre, post, fExpr->bin.left, arg1, arg2);
            fExpr->bin.right = ApplyToNodes(pre, post, fExpr->bin.right, arg1, arg2);
            break;
        case TRINARY_N:
            fExpr->tri.arg1 = ApplyToNodes(pre, post, fExpr->tri.arg1, arg1, arg2);
            fExpr->tri.arg2 = ApplyToNodes(pre, post, fExpr->tri.arg2, arg1, arg2);
            fExpr->tri.arg3 = ApplyToNodes(pre, post, fExpr->tri.arg3, arg1, arg2);
            break;
        default:
            assert(!"bad kind to ApplyToNodes()");
            break;
        }
        if (post) fExpr = post(fExpr, arg1, arg2);
    }
    return fExpr;
} // ApplyToNodes

/*
 * ApplyToExpressions() - Walk a source tree and apply "fun" to each node in each
 *         expression in prefix order.
 */

void ApplyToExpressions(expr *(*pre)(expr *, void *, int),
                        expr *(*post)(expr *, void *, int),
                        stmt *fStmt, void *arg1, int arg2)
{
    while (fStmt) {
        Cg->lastSourceLoc = fStmt->commonst.loc;
        switch (fStmt->exprst.kind) {
        case EXPR_STMT:
            fStmt->exprst.exp = ApplyToNodes(pre, post, fStmt->exprst.exp, arg1, arg2);
            break;
        case IF_STMT:
            fStmt->ifst.cond = ApplyToNodes(pre, post, fStmt->ifst.cond, arg1, arg2);
            ApplyToExpressions(pre, post, fStmt->ifst.thenstmt, arg1, arg2);
            ApplyToExpressions(pre, post, fStmt->ifst.elsestmt, arg1, arg2);
            break;
        case WHILE_STMT:
        case DO_STMT:
            fStmt->whilest.cond = ApplyToNodes(pre, post, fStmt->whilest.cond, arg1, arg2);
            ApplyToExpressions(pre, post, fStmt->whilest.body, arg1, arg2);
            break;
        case FOR_STMT:
            ApplyToExpressions(pre, post, fStmt->forst.init, arg1, arg2);
            fStmt->forst.cond = ApplyToNodes(pre, post, fStmt->forst.cond, arg1, arg2);
            ApplyToExpressions(pre, post, fStmt->forst.body, arg1, arg2);
            ApplyToExpressions(pre, post, fStmt->forst.step, arg1, arg2);
            break;
        case BLOCK_STMT:
            ApplyToExpressions(pre, post, fStmt->blockst.body, arg1, arg2);
            break;
        case RETURN_STMT:
            fStmt->returnst.exp = ApplyToNodes(pre, post, fStmt->returnst.exp, arg1, arg2);
            break;
        case DISCARD_STMT:
            fStmt->discardst.cond = ApplyToNodes(pre, post, fStmt->discardst.cond, arg1, arg2);
            break;
        case COMMENT_STMT:
            break;
        default:
            assert(0);
            break;
        }
        fStmt = fStmt->exprst.next;
    }
} // ApplyToExpressions

/*
 * ApplyToExpressionsLocal() - Apply a function to each node in the expressions contained in
 *         a single statement.
 */

void ApplyToExpressionsLocal(expr *(*pre)(expr *, void *, int),
                             expr *(*post)(expr *, void *, int),
                             stmt *fStmt, void *arg1, int arg2)
{
    if (fStmt) {
        Cg->lastSourceLoc = fStmt->commonst.loc;
        switch (fStmt->exprst.kind) {
        case EXPR_STMT:
            fStmt->exprst.exp = ApplyToNodes(pre, post, fStmt->exprst.exp, arg1, arg2);
            break;
        case IF_STMT:
            fStmt->ifst.cond = ApplyToNodes(pre, post, fStmt->ifst.cond, arg1, arg2);
            break;
        case WHILE_STMT:
        case DO_STMT:
            fStmt->whilest.cond = ApplyToNodes(pre, post, fStmt->whilest.cond, arg1, arg2);
            break;
        case FOR_STMT:
            fStmt->forst.cond = ApplyToNodes(pre, post, fStmt->forst.cond, arg1, arg2);
            break;
        case BLOCK_STMT:
            break;
        case RETURN_STMT:
            fStmt->returnst.exp = ApplyToNodes(pre, post, fStmt->returnst.exp, arg1, arg2);
            break;
        case DISCARD_STMT:
            fStmt->discardst.cond = ApplyToNodes(pre, post, fStmt->discardst.cond, arg1, arg2);
            break;
        case COMMENT_STMT:
            break;
        default:
            assert(0);
            break;
        }
        //fStmt = fStmt->exprst.next;
    }
} // ApplyToExpressionsLocal

/*
 * ApplyToTopExpressions() - Walk a source tree and apply a function to each expression.
 *
 */

void ApplyToTopExpressions(expr *(*fun)(expr *, void *, int), stmt *fStmt, void *arg1, int arg2)
{
    while (fStmt) {
        Cg->lastSourceLoc = fStmt->commonst.loc;
        switch (fStmt->exprst.kind) {
        case EXPR_STMT:
            fStmt->exprst.exp = fun(fStmt->exprst.exp, arg1, arg2);
            break;
        case IF_STMT:
            fStmt->ifst.cond = fun(fStmt->ifst.cond, arg1, arg2);
            ApplyToTopExpressions(fun, fStmt->ifst.thenstmt, arg1, arg2);
            ApplyToTopExpressions(fun, fStmt->ifst.elsestmt, arg1, arg2);
            break;
        case WHILE_STMT:
        case DO_STMT:
            fStmt->whilest.cond = fun(fStmt->whilest.cond, arg1, arg2);
            ApplyToTopExpressions(fun, fStmt->whilest.body, arg1, arg2);
            break;
        case FOR_STMT:
            ApplyToTopExpressions(fun, fStmt->forst.init, arg1, arg2);
            fStmt->forst.cond = fun(fStmt->forst.cond, arg1, arg2);
            ApplyToTopExpressions(fun, fStmt->forst.body, arg1, arg2);
            ApplyToTopExpressions(fun, fStmt->forst.step, arg1, arg2);
            break;
        case BLOCK_STMT:
            ApplyToTopExpressions(fun, fStmt->blockst.body, arg1, arg2);
            break;
        case RETURN_STMT:
            fStmt->returnst.exp = fun(fStmt->returnst.exp, arg1, arg2);
            break;
        case DISCARD_STMT:
            fStmt->discardst.cond = fun(fStmt->discardst.cond, arg1, arg2);
            break;
        case COMMENT_STMT:
            break;
        default:
            assert(0);
            break;
        }
        fStmt = fStmt->exprst.next;
    }
} // ApplyToTopExpressions

/*
 * ApplyToStatements() - Walk a source tree and apply a transformations to
 *    each statememt
 */

stmt *ApplyToStatements(stmt *(*pre)(stmt *, void *, int),
                        stmt *(*post)(stmt *, void *, int),
                        stmt *fStmt, void *arg1, int arg2)
{
    stmt *head = NULL, *last = NULL, *lStmt, *next, *rest = fStmt;

    while (fStmt) {
        // Transform each statement into a possible NULL list of statements:
        // Prepend any statements returned to the list to be processed, and
        // remember what the next one to be done is (rest), so we don't
        // rerun pre on any of the returned statements directly.
        if (pre && rest == fStmt) {
            Cg->lastSourceLoc = fStmt->commonst.loc;
            rest = fStmt->commonst.next;
            fStmt->commonst.next = NULL;
            lStmt = pre(fStmt, arg1, arg2);
            if (lStmt) {
                fStmt = lStmt;
                while (lStmt->commonst.next && lStmt->commentst.next != rest) {
                    lStmt = lStmt->commonst.next;
                }
                lStmt->commonst.next = rest;
            } else {
                // Nothing returned - go to next statement:
                fStmt = rest;
                continue;
            }
        }

        // Now apply transformation to substatements:

        switch (fStmt->exprst.kind) {
        case EXPR_STMT:
            break;
        case IF_STMT:
            fStmt->ifst.thenstmt = ApplyToStatements(pre, post, fStmt->ifst.thenstmt, arg1, arg2);
            fStmt->ifst.elsestmt = ApplyToStatements(pre, post, fStmt->ifst.elsestmt, arg1, arg2);
            break;
        case WHILE_STMT:
        case DO_STMT:
            fStmt->whilest.body = ApplyToStatements(pre, post, fStmt->whilest.body, arg1, arg2);
            break;
        case FOR_STMT:
            fStmt->forst.init = ApplyToStatements(pre, post, fStmt->forst.init, arg1, arg2);
            fStmt->forst.body = ApplyToStatements(pre, post, fStmt->forst.body, arg1, arg2);
            fStmt->forst.step = ApplyToStatements(pre, post, fStmt->forst.step, arg1, arg2);
            break;
        case BLOCK_STMT:
            fStmt->blockst.body = ApplyToStatements(pre, post, fStmt->blockst.body, arg1, arg2);
            break;
        case RETURN_STMT:
        case DISCARD_STMT:
        case COMMENT_STMT:
            break;
        default:
            assert(0);
            break;
        }

        // Append any statements returned by "post" to the end of the list:

        next = fStmt->commonst.next;
        if (post) {
            Cg->lastSourceLoc = fStmt->commonst.loc;
            lStmt = post(fStmt, arg1, arg2);
        } else {
            lStmt = fStmt;
        }
        if (lStmt) {
            if (head) {
                last->commonst.next = lStmt;
            } else {
                head = lStmt;
            }
            last = lStmt;
            while (last->commonst.next && last->commentst.next != next) {
                last = last->commonst.next;
            }
            last->commonst.next = NULL;
        }
        fStmt = next;
    }
    return head;
} // ApplyToStatements

/*
 * PostApplyToChildStatements() - Apply a postfix order transformation to each child
 *         statememt of this statement.
 */

void PostApplyToChildStatements(stmt *(*fun)(stmt *, void *, int), stmt *fStmt, void *arg1, int arg2)
{
    if (fStmt) {

        // Apply a transformation to each nested statement, but not the top level statements:

        Cg->lastSourceLoc = fStmt->commonst.loc;
        switch (fStmt->exprst.kind) {
        case EXPR_STMT:
            break;
        case IF_STMT:
            fStmt->ifst.thenstmt = PostApplyToStatements(fun, fStmt->ifst.thenstmt, arg1, arg2);
            fStmt->ifst.elsestmt = PostApplyToStatements(fun, fStmt->ifst.elsestmt, arg1, arg2);
            break;
        case WHILE_STMT:
        case DO_STMT:
            fStmt->whilest.body = PostApplyToStatements(fun, fStmt->whilest.body, arg1, arg2);
            break;
        case FOR_STMT:
            fStmt->forst.init = PostApplyToStatements(fun, fStmt->forst.init, arg1, arg2);
            fStmt->forst.body = PostApplyToStatements(fun, fStmt->forst.body, arg1, arg2);
            fStmt->forst.step = PostApplyToStatements(fun, fStmt->forst.step, arg1, arg2);
            break;
        case BLOCK_STMT:
            fStmt->blockst.body = PostApplyToStatements(fun, fStmt->blockst.body, arg1, arg2);
            break;
        case RETURN_STMT:
        case DISCARD_STMT:
        case COMMENT_STMT:
            break;
        default:
            assert(0);
            break;
        }
    }
} // PostApplyToChildStatements

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99国产精品久| 久久精品一区二区三区不卡牛牛| 成人激情午夜影院| 国产精品小仙女| 另类小说图片综合网| 久久国产剧场电影| 狠狠色丁香久久婷婷综合_中| 久久99久久精品| 国产一区二区三区电影在线观看 | 亚洲午夜激情网站| 一区二区三区在线视频观看| 一区二区三区在线观看国产| 亚洲综合视频网| 亚洲尤物在线视频观看| 亚洲高清在线精品| 日韩电影在线看| 看国产成人h片视频| 狠狠色狠狠色综合| 不卡的电影网站| 91福利资源站| 欧美日本一区二区三区| 在线成人午夜影院| 精品电影一区二区| 国产日产欧美一区| 亚洲天堂a在线| 亚洲第一精品在线| 日本欧美韩国一区三区| 国产高清不卡二三区| av一区二区三区| 欧美日免费三级在线| 91精品国产色综合久久不卡电影| 精品国产髙清在线看国产毛片| 久久伊人中文字幕| 1000精品久久久久久久久| 亚洲色图19p| 日韩电影在线观看一区| 国产成人综合网| 色婷婷国产精品久久包臀| 7777精品伊人久久久大香线蕉最新版| 日韩欧美一区二区三区在线| 国产欧美一区二区精品性色超碰| 亚洲视频在线观看一区| 日本亚洲天堂网| 国产69精品久久777的优势| 欧美四级电影在线观看| 精品免费一区二区三区| 中文字幕在线观看一区二区| 婷婷成人综合网| 成人开心网精品视频| 欧美日韩1234| 国产精品污污网站在线观看| 日韩av一级片| 色女孩综合影院| 久久视频一区二区| 亚洲国产一区视频| 国产精品18久久久久久久网站| 欧美这里有精品| 国产日韩欧美精品在线| 香蕉成人伊视频在线观看| 国产成人av一区二区| 欧美美女激情18p| 国产亚洲成aⅴ人片在线观看| 亚洲国产sm捆绑调教视频| 成人午夜短视频| 日韩精品一区二区三区视频| 亚洲乱码国产乱码精品精小说| 麻豆精品一区二区三区| 欧美日韩一区二区在线观看| 国产精品视频在线看| 极品少妇xxxx偷拍精品少妇| 欧美色综合天天久久综合精品| 国产亚洲精品资源在线26u| 男女男精品网站| 欧洲一区在线观看| 国产精品高潮久久久久无| 国模套图日韩精品一区二区| 欧美久久久影院| 亚洲精品水蜜桃| 成人免费视频播放| 久久综合色综合88| 免费成人av在线| 欧美人与性动xxxx| 亚洲免费观看在线观看| 成人动漫av在线| 国产午夜精品理论片a级大结局| 久久爱www久久做| 91精品国模一区二区三区| 一区二区三区日韩欧美精品| 99久久婷婷国产综合精品电影| 精品国产3级a| 美女一区二区在线观看| 在线播放亚洲一区| 一区二区激情视频| 色88888久久久久久影院野外| 综合久久国产九一剧情麻豆| av福利精品导航| 国产精品国产馆在线真实露脸| 成人综合在线观看| 亚洲国产高清在线观看视频| 国产成人综合亚洲网站| 久久久久高清精品| 国产精品亚洲综合一区在线观看| 久久久久久久久久久久久夜| 国产乱理伦片在线观看夜一区| 日韩一级大片在线观看| 蜜桃久久久久久| 欧美mv日韩mv亚洲| 久久电影网站中文字幕| 日韩免费观看高清完整版在线观看| 日韩成人免费电影| 日韩网站在线看片你懂的| 麻豆成人久久精品二区三区小说| 日韩一区二区麻豆国产| 激情小说亚洲一区| 久久久精品免费网站| 处破女av一区二区| 亚洲激情av在线| 欧美日韩国产精品成人| 蜜臀av在线播放一区二区三区| 精品久久久久av影院| 久久99深爱久久99精品| 久久久.com| 91碰在线视频| 午夜久久久久久久久久一区二区| 欧美一卡2卡三卡4卡5免费| 久久99国产精品免费网站| 欧美国产一区二区| 99综合影院在线| 亚洲成人综合视频| 精品国产乱码久久久久久久| 成人av手机在线观看| 一区二区久久久久久| 日韩欧美在线123| 国产盗摄视频一区二区三区| 亚洲人123区| 欧美一级精品在线| 国产电影一区二区三区| 国产精品久久久久久久久晋中| 在线观看日韩电影| 国内精品伊人久久久久av一坑| 国产精品网站导航| 欧美午夜不卡在线观看免费| 韩国一区二区三区| 自拍偷拍亚洲综合| 日韩欧美久久久| 99热这里都是精品| 午夜视频在线观看一区| 久久综合国产精品| 在线观看亚洲精品| 国内成人精品2018免费看| 亚洲精品午夜久久久| 精品99999| 欧美自拍丝袜亚洲| 国产久卡久卡久卡久卡视频精品| 亚洲激情男女视频| 久久精品网站免费观看| 欧美日韩国产天堂| 成人永久免费视频| 日韩专区中文字幕一区二区| 国产精品视频线看| 制服丝袜亚洲色图| 成年人国产精品| 久久国产综合精品| 亚洲精品视频一区| 国产人伦精品一区二区| 欧美精品 国产精品| av在线不卡观看免费观看| 久久精品二区亚洲w码| 亚洲黄色在线视频| 国产偷国产偷精品高清尤物| 91精品欧美久久久久久动漫| 色综合色综合色综合色综合色综合| 久久99国产精品麻豆| 亚洲午夜一区二区| 中文字幕视频一区| 久久中文娱乐网| 欧美精品色综合| 99热99精品| 成人免费观看视频| 精品一区二区免费在线观看| 午夜精品免费在线观看| 亚洲婷婷国产精品电影人久久| 久久久亚洲精品一区二区三区| 欧美人动与zoxxxx乱| 色综合天天天天做夜夜夜夜做| 国产精品亚洲专一区二区三区| 日韩精品91亚洲二区在线观看| 自拍偷拍国产精品| 欧美国产禁国产网站cc| 精品国产乱码久久久久久牛牛| 欧美军同video69gay| 91国在线观看| 色综合久久88色综合天天6 | 日韩你懂的在线观看| 欧美精品第一页| 欧美日韩在线亚洲一区蜜芽| 日本黄色一区二区| 色综合色狠狠综合色| 99精品国产视频| 99久久99久久免费精品蜜臀|