本文整理汇总了C++中FoldingSetNodeID::AddBoolean方法的典型用法代码示例。如果您正苦于以下问题:C++ FoldingSetNodeID::AddBoolean方法的具体用法?C++ FoldingSetNodeID::AddBoolean怎么用?C++ FoldingSetNodeID::AddBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FoldingSetNodeID
的用法示例。
在下文中一共展示了FoldingSetNodeID::AddBoolean方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: profileFunction
/// Creates a hash-code for the function which is the same for any two
/// functions that will compare equal, without looking at the instructions
/// inside the function.
static unsigned profileFunction(const Function *F) {
FunctionType *FTy = F->getFunctionType();
FoldingSetNodeID ID;
ID.AddInteger(F->size());
ID.AddInteger(F->getCallingConv());
ID.AddBoolean(F->hasGC());
ID.AddBoolean(FTy->isVarArg());
ID.AddInteger(getTypeIDForHash(FTy->getReturnType()));
for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i)
ID.AddInteger(getTypeIDForHash(FTy->getParamType(i)));
return ID.ComputeHash();
}
示例2: switch
MDNode *MDNode::getMDNode(LLVMContext &Context, Value *const *Vals,
unsigned NumVals, FunctionLocalness FL,
bool Insert) {
LLVMContextImpl *pImpl = Context.pImpl;
bool isFunctionLocal = false;
switch (FL) {
case FL_Unknown:
for (unsigned i = 0; i != NumVals; ++i) {
Value *V = Vals[i];
if (!V) continue;
if (isFunctionLocalValue(V)) {
isFunctionLocal = true;
break;
}
}
break;
case FL_No:
isFunctionLocal = false;
break;
case FL_Yes:
isFunctionLocal = true;
break;
}
FoldingSetNodeID ID;
for (unsigned i = 0; i != NumVals; ++i)
ID.AddPointer(Vals[i]);
ID.AddBoolean(isFunctionLocal);
void *InsertPoint;
MDNode *N = NULL;
if ((N = pImpl->MDNodeSet.FindNodeOrInsertPos(ID, InsertPoint)))
return N;
if (!Insert)
return NULL;
// Coallocate space for the node and Operands together, then placement new.
void *Ptr = malloc(sizeof(MDNode)+NumVals*sizeof(MDNodeOperand));
N = new (Ptr) MDNode(Context, Vals, NumVals, isFunctionLocal);
// InsertPoint will have been set by the FindNodeOrInsertPos call.
pImpl->MDNodeSet.InsertNode(N, InsertPoint);
return N;
}
示例3: Profile
void MDNode::Profile(FoldingSetNodeID &ID) const {
for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
ID.AddPointer(getOperand(i));
ID.AddBoolean(isFunctionLocal());
}
示例4: Profile
void ConstantBool::Profile(FoldingSetNodeID &ID, const Type *Ty,
const bool &Val) {
ID.Add(Ty);
ID.AddBoolean(Val);
}