本文整理汇总了C++中StoredDeclsMap::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ StoredDeclsMap::insert方法的具体用法?C++ StoredDeclsMap::insert怎么用?C++ StoredDeclsMap::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StoredDeclsMap
的用法示例。
在下文中一共展示了StoredDeclsMap::insert方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
DeclContext::lookup_result
DeclContext::lookup(DeclarationName Name) {
assert(DeclKind != Decl::LinkageSpec &&
"Should not perform lookups into linkage specs!");
DeclContext *PrimaryContext = getPrimaryContext();
if (PrimaryContext != this)
return PrimaryContext->lookup(Name);
if (hasExternalVisibleStorage()) {
StoredDeclsMap *Map = LookupPtr.getPointer();
if (LookupPtr.getInt())
Map = buildLookup();
else if (NeedToReconcileExternalVisibleStorage)
reconcileExternalVisibleStorage();
if (!Map)
Map = CreateStoredDeclsMap(getParentASTContext());
// If a PCH/module has a result for this name, and we have a local
// declaration, we will have imported the PCH/module result when adding the
// local declaration or when reconciling the module.
std::pair<StoredDeclsMap::iterator, bool> R =
Map->insert(std::make_pair(Name, StoredDeclsList()));
if (!R.second)
return R.first->second.getLookupResult();
ExternalASTSource *Source = getParentASTContext().getExternalSource();
if (Source->FindExternalVisibleDeclsByName(this, Name)) {
if (StoredDeclsMap *Map = LookupPtr.getPointer()) {
StoredDeclsMap::iterator I = Map->find(Name);
if (I != Map->end())
return I->second.getLookupResult();
}
}
return lookup_result(lookup_iterator(0), lookup_iterator(0));
}
StoredDeclsMap *Map = LookupPtr.getPointer();
if (LookupPtr.getInt())
Map = buildLookup();
if (!Map)
return lookup_result(lookup_iterator(0), lookup_iterator(0));
StoredDeclsMap::iterator I = Map->find(Name);
if (I == Map->end())
return lookup_result(lookup_iterator(0), lookup_iterator(0));
return I->second.getLookupResult();
}