本文整理汇总了C++中Factory::Add方法的典型用法代码示例。如果您正苦于以下问题:C++ Factory::Add方法的具体用法?C++ Factory::Add怎么用?C++ Factory::Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Factory
的用法示例。
在下文中一共展示了Factory::Add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddGT
RangeSet AddGT(BasicValueFactory &BV, Factory &F, const llvm::APSInt &V) {
PrimRangeSet newRanges = F.GetEmptySet();
for (PrimRangeSet::iterator i = begin(), e = end(); i != e; ++i) {
if (i->Includes(V) && i->To() > V)
newRanges = F.Add(newRanges, Range(BV.Add1(V), i->To()));
else if (i->From() > V)
newRanges = F.Add(newRanges, *i);
}
return newRanges;
}
示例2: AddGE
RangeSet AddGE(BasicValueFactory &BV, Factory &F, const llvm::APSInt &V) {
PrimRangeSet newRanges = F.GetEmptySet();
for (PrimRangeSet::iterator i = begin(), e = end(); i != e; ++i) {
// Strictly we should test for includes *V - 1, but no harm is
// done by this formulation
if (i->Includes(V))
newRanges = F.Add(newRanges, Range(V, i->To()));
else if (i->From() >= V)
newRanges = F.Add(newRanges, *i);
}
return newRanges;
}
示例3: AddNE
/// AddNE - Create a new RangeSet with the additional constraint that the
/// value be not be equal to V.
RangeSet AddNE(BasicValueFactory &BV, Factory &F, const llvm::APSInt &V) {
PrimRangeSet newRanges = ranges;
// FIXME: We can perhaps enhance ImmutableSet to do this search for us
// in log(N) time using the sorted property of the internal AVL tree.
for (iterator i = begin(), e = end(); i != e; ++i) {
if (i->Includes(V)) {
// Remove the old range.
newRanges = F.Remove(newRanges, *i);
// Split the old range into possibly one or two ranges.
if (V != i->From())
newRanges = F.Add(newRanges, Range(i->From(), BV.Sub1(V)));
if (V != i->To())
newRanges = F.Add(newRanges, Range(BV.Add1(V), i->To()));
// All of the ranges are non-overlapping, so we can stop.
break;
}
}
return newRanges;
}
示例4: RangeSet
/// Construct a new RangeSet representing '{ [from, to] }'.
RangeSet(Factory &F, const llvm::APSInt &from, const llvm::APSInt &to)
: ranges(F.Add(F.GetEmptySet(), Range(from, to))) {}