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


C++ APInt::ne方法代码示例

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


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

示例1: Range

/*
 * function meet
 *
 * Here we perform the meet operation in the interval lattice,
 * using Cousot's narrowing operator. We meet the current abstract state
 * with the new_abstract_state and update the current abstract state of
 * the node.
 *
 * This function returns true if the current abstract state has changed.
 */
bool llvm::RangeAnalysis::meet(GraphNode* Node, Range new_abstract_state){

	Range oldInterval = out_state[Node];
	APInt oLower = out_state[Node].getLower();
	APInt oUpper = out_state[Node].getUpper();
	Range newInterval = new_abstract_state;

	APInt nLower = newInterval.getLower();
	APInt nUpper = newInterval.getUpper();

	if (narrowing_count[Node] < MaxIterationCount) {

		if (oLower.eq(Min) && nLower.ne(Min)) {
			out_state[Node] = Range(nLower, oUpper);
		} else {
			APInt smin = APIntOps::smin(oLower, nLower);
			if (oLower.ne(smin)) {
				out_state[Node] = Range(smin, oUpper);
			}
		}

		if (oUpper.eq(Max) && nUpper.ne(Max)) {
			out_state[Node] = Range(out_state[Node].getLower(), nUpper);
		} else {
			APInt smax = APIntOps::smax(oUpper, nUpper);
			if (oUpper.ne(smax)) {
				out_state[Node] = Range(out_state[Node].getLower(), smax);
			}
		}

	}

	if (SigmaOpNode* Sigma = dyn_cast<SigmaOpNode>(Node)){

		if (branchConstraints.count(Sigma) > 0) {
			out_state[Node] = out_state[Node].intersectWith(branchConstraints[Sigma]->getRange());
		}
	}

	bool hasChanged = oldInterval != out_state[Node];

	if (hasChanged) narrowing_count[Node]++;

	return hasChanged;
}
开发者ID:hityangzhen,项目名称:range-analysis,代码行数:55,代码来源:RangeAnalysis.cpp


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