當前位置: 首頁>>代碼示例>>Java>>正文


Java ValueNumberDataflow.getStartFact方法代碼示例

本文整理匯總了Java中edu.umd.cs.findbugs.ba.vna.ValueNumberDataflow.getStartFact方法的典型用法代碼示例。如果您正苦於以下問題:Java ValueNumberDataflow.getStartFact方法的具體用法?Java ValueNumberDataflow.getStartFact怎麽用?Java ValueNumberDataflow.getStartFact使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在edu.umd.cs.findbugs.ba.vna.ValueNumberDataflow的用法示例。


在下文中一共展示了ValueNumberDataflow.getStartFact方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: findPreviouslyDeadBlocks

import edu.umd.cs.findbugs.ba.vna.ValueNumberDataflow; //導入方法依賴的package包/類
/**
 * Find set of blocks which were known to be dead before doing the null
 * pointer analysis.
 * 
 * @return set of previously dead blocks, indexed by block id
 * @throws CFGBuilderException
 * @throws DataflowAnalysisException
 */
private BitSet findPreviouslyDeadBlocks() throws DataflowAnalysisException, CFGBuilderException {
    BitSet deadBlocks = new BitSet();
    ValueNumberDataflow vnaDataflow = classContext.getValueNumberDataflow(method);
    for (Iterator<BasicBlock> i = vnaDataflow.getCFG().blockIterator(); i.hasNext();) {
        BasicBlock block = i.next();
        ValueNumberFrame vnaFrame = vnaDataflow.getStartFact(block);
        if (vnaFrame.isTop()) {
            deadBlocks.set(block.getLabel());
        }
    }

    return deadBlocks;
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:22,代碼來源:NoiseNullDeref.java

示例2: getParameterValueNumbers

import edu.umd.cs.findbugs.ba.vna.ValueNumberDataflow; //導入方法依賴的package包/類
private Set<ValueNumber> getParameterValueNumbers(ClassContext classContext, Method method, CFG cfg)
        throws DataflowAnalysisException, CFGBuilderException {
    ValueNumberDataflow vnaDataflow = classContext.getValueNumberDataflow(method);
    ValueNumberFrame vnaFrameAtEntry = vnaDataflow.getStartFact(cfg.getEntry());
    Set<ValueNumber> paramValueNumberSet = new HashSet<ValueNumber>();
    int firstParam = method.isStatic() ? 0 : 1;
    for (int i = firstParam; i < vnaFrameAtEntry.getNumLocals(); ++i) {
        paramValueNumberSet.add(vnaFrameAtEntry.getValue(i));
    }
    return paramValueNumberSet;
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:12,代碼來源:FindBadCast2.java

示例3: findPreviouslyDeadBlocks

import edu.umd.cs.findbugs.ba.vna.ValueNumberDataflow; //導入方法依賴的package包/類
/**
 * Find set of blocks which were known to be dead before doing the null
 * pointer analysis.
 *
 * @return set of previously dead blocks, indexed by block id
 * @throws CFGBuilderException
 * @throws DataflowAnalysisException
 */
private BitSet findPreviouslyDeadBlocks() throws DataflowAnalysisException, CFGBuilderException {
    BitSet deadBlocks = new BitSet();
    ValueNumberDataflow vnaDataflow = classContext.getValueNumberDataflow(method);
    for (Iterator<BasicBlock> i = vnaDataflow.getCFG().blockIterator(); i.hasNext();) {
        BasicBlock block = i.next();
        ValueNumberFrame vnaFrame = vnaDataflow.getStartFact(block);
        if (vnaFrame.isTop()) {
            deadBlocks.set(block.getLabel());
        }
    }

    return deadBlocks;
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:22,代碼來源:FindNullDeref.java


注:本文中的edu.umd.cs.findbugs.ba.vna.ValueNumberDataflow.getStartFact方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。