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


C++ DenseSet::count方法代码示例

本文整理汇总了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
}
开发者ID:nanwu,项目名称:pyston,代码行数:25,代码来源:icinfo.cpp

示例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;
}
开发者ID:aisobe,项目名称:swift,代码行数:24,代码来源:ARCAnalysis.cpp

示例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;
  });
}
开发者ID:uygar,项目名称:swift,代码行数:17,代码来源:LoopRotate.cpp

示例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());
 }
开发者ID:aamedina,项目名称:cling,代码行数:20,代码来源:AutoSynthesizer.cpp

示例5: deregisterGCTrackedICInfo

void deregisterGCTrackedICInfo(ICInfo* ic) {
#if MOVING_GC
    assert(ics_list.count(ic) == 1);
    ics_list.erase(ic);
#endif
}
开发者ID:nanwu,项目名称:pyston,代码行数:6,代码来源:icinfo.cpp

示例6: registerGCTrackedICInfo

void registerGCTrackedICInfo(ICInfo* ic) {
#if MOVING_GC
    assert(ics_list.count(ic) == 0);
    ics_list.insert(ic);
#endif
}
开发者ID:nanwu,项目名称:pyston,代码行数:6,代码来源:icinfo.cpp

示例7: isInterceptedFunction

 bool isInterceptedFunction(uintptr_t Address) const {
   return InterceptorAddresses.count(Address);
 }
开发者ID:mheinsen,项目名称:seec,代码行数:3,代码来源:Tracer.hpp

示例8: isReferenced

 /// \brief Check if a Decl is referenced by non-system code.
 ///
 bool isReferenced(::clang::Decl const *D) const {
   return DeclsReferenced.count(D);
 }
开发者ID:mheinsen,项目名称:seec,代码行数:5,代码来源:MappedAST.hpp


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