本文整理汇总了C++中llvm::DenseMap::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ DenseMap::erase方法的具体用法?C++ DenseMap::erase怎么用?C++ DenseMap::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类llvm::DenseMap
的用法示例。
在下文中一共展示了DenseMap::erase方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: erase
void erase(SILFunction *F) {
// If this function is a mapped closure scope, remove it, leaving a nullptr
// sentinel.
auto indexPos = scopeToIndexMap.find(F);
if (indexPos != scopeToIndexMap.end()) {
indexedScopes[indexPos->second] = nullptr;
scopeToIndexMap.erase(F);
}
// If this function is a closure, remove it.
closureToScopesMap.erase(F);
}
示例2: commit
void ICSlotRewrite::commit(CommitHook* hook, std::vector<void*> gc_references) {
bool still_valid = true;
for (int i = 0; i < dependencies.size(); i++) {
int orig_version = dependencies[i].second;
ICInvalidator* invalidator = dependencies[i].first;
if (orig_version != invalidator->version()) {
still_valid = false;
break;
}
}
if (!still_valid) {
if (VERBOSITY() >= 3)
printf("not committing %s icentry since a dependency got updated before commit\n", debug_name);
return;
}
uint8_t* slot_start = getSlotStart();
uint8_t* continue_point = (uint8_t*)ic->continue_addr;
bool do_commit = hook->finishAssembly(continue_point - slot_start);
if (!do_commit)
return;
assert(!assembler.hasFailed());
for (int i = 0; i < dependencies.size(); i++) {
ICInvalidator* invalidator = dependencies[i].first;
invalidator->addDependent(ic_entry);
}
ic->next_slot_to_try++;
// if (VERBOSITY()) printf("Commiting to %p-%p\n", start, start + ic->slot_size);
memcpy(slot_start, buf, ic->getSlotSize());
for (auto p : ic_entry->gc_references) {
int& i = ic_gc_references[p];
if (i == 1)
ic_gc_references.erase(p);
else
--i;
}
ic_entry->gc_references = std::move(gc_references);
for (auto p : ic_entry->gc_references)
ic_gc_references[p]++;
ic->times_rewritten++;
if (ic->times_rewritten == IC_MEGAMORPHIC_THRESHOLD) {
static StatCounter megamorphic_ics("megamorphic_ics");
megamorphic_ics.log();
}
llvm::sys::Memory::InvalidateInstructionCache(slot_start, ic->getSlotSize());
}
示例3: deregisterCompiledPatchpoint
void deregisterCompiledPatchpoint(ICInfo* ic) {
assert(ics_by_return_addr.count(ic->slowpath_rtn_addr));
ics_by_return_addr.erase(ic->slowpath_rtn_addr);
deregisterGCTrackedICInfo(ic);
}