本文整理汇总了C++中llvm::DenseSet::count方法的典型用法代码示例。如果您正苦于以下问题:C++ DenseSet::count方法的具体用法?C++ DenseSet::count怎么用?C++ DenseSet::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类llvm::DenseSet
的用法示例。
在下文中一共展示了DenseSet::count方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
ICInfo::ICInfo(void* start_addr, void* slowpath_rtn_addr, void* continue_addr, StackInfo stack_info, int num_slots,
int slot_size, llvm::CallingConv::ID calling_conv, LiveOutSet _live_outs,
assembler::GenericRegister return_register, TypeRecorder* type_recorder)
: next_slot_to_try(0),
stack_info(stack_info),
num_slots(num_slots),
slot_size(slot_size),
calling_conv(calling_conv),
live_outs(std::move(_live_outs)),
return_register(return_register),
type_recorder(type_recorder),
retry_in(0),
retry_backoff(1),
times_rewritten(0),
start_addr(start_addr),
slowpath_rtn_addr(slowpath_rtn_addr),
continue_addr(continue_addr) {
for (int i = 0; i < num_slots; i++) {
slots.emplace_back(this, i);
}
#if MOVING_GC
assert(ics_list.count(this) == 0);
#endif
}
示例2: isTransitiveSuccessorsRetainFree
bool ConsumedResultToEpilogueRetainMatcher::isTransitiveSuccessorsRetainFree(
const llvm::DenseSet<SILBasicBlock *> &BBs) {
// For every block with retain, we need to check the transitive
// closure of its successors are retain-free.
for (auto &I : EpilogueRetainInsts) {
for (auto &Succ : I->getParent()->getSuccessors()) {
if (BBs.count(Succ))
continue;
return false;
}
}
// FIXME: We are iterating over a DenseSet. That can lead to non-determinism
// and is in general pretty inefficient since we are iterating over a hash
// table.
for (auto CBB : BBs) {
for (auto &Succ : CBB->getSuccessors()) {
if (BBs.count(Succ))
continue;
return false;
}
}
return true;
}
示例3: hasLoopInvariantOperands
/// Check whether all operands are loop invariant.
static bool hasLoopInvariantOperands(SILInstruction *I, SILLoop *L,
llvm::DenseSet<SILInstruction *> &Inv) {
auto Opds = I->getAllOperands();
return std::all_of(Opds.begin(), Opds.end(), [=](Operand &Op) {
ValueBase *Def = Op.get();
// Operand is outside the loop or marked invariant.
if (auto *Inst = Def->getDefiningInstruction())
return !L->contains(Inst->getParent()) || Inv.count(Inst);
if (auto *Arg = dyn_cast<SILArgument>(Def))
return !L->contains(Arg->getParent());
return false;
});
}
示例4: Fix
void Fix(CompoundStmt* CS) {
if (!CS->size())
return;
typedef llvm::SmallVector<Stmt*, 32> Statements;
Statements Stmts;
Stmts.append(CS->body_begin(), CS->body_end());
for (Statements::iterator I = Stmts.begin(); I != Stmts.end(); ++I) {
if (!TraverseStmt(*I) && !m_HandledDecls.count(m_FoundDRE->getDecl())) {
Sema::DeclGroupPtrTy VDPtrTy
= m_Sema->ConvertDeclToDeclGroup(m_FoundDRE->getDecl());
StmtResult DS = m_Sema->ActOnDeclStmt(VDPtrTy,
m_FoundDRE->getLocStart(),
m_FoundDRE->getLocEnd());
assert(!DS.isInvalid() && "Invalid DeclStmt.");
I = Stmts.insert(I, DS.take());
m_HandledDecls.insert(m_FoundDRE->getDecl());
}
}
CS->setStmts(m_Sema->getASTContext(), Stmts.data(), Stmts.size());
}
示例5: deregisterGCTrackedICInfo
void deregisterGCTrackedICInfo(ICInfo* ic) {
#if MOVING_GC
assert(ics_list.count(ic) == 1);
ics_list.erase(ic);
#endif
}
示例6: registerGCTrackedICInfo
void registerGCTrackedICInfo(ICInfo* ic) {
#if MOVING_GC
assert(ics_list.count(ic) == 0);
ics_list.insert(ic);
#endif
}
示例7: isInterceptedFunction
bool isInterceptedFunction(uintptr_t Address) const {
return InterceptorAddresses.count(Address);
}
示例8: isReferenced
/// \brief Check if a Decl is referenced by non-system code.
///
bool isReferenced(::clang::Decl const *D) const {
return DeclsReferenced.count(D);
}