本文整理汇总了C++中DebuggerClient::lookupAdditions方法的典型用法代码示例。如果您正苦于以下问题:C++ DebuggerClient::lookupAdditions方法的具体用法?C++ DebuggerClient::lookupAdditions怎么用?C++ DebuggerClient::lookupAdditions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DebuggerClient
的用法示例。
在下文中一共展示了DebuggerClient::lookupAdditions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Consumer
//.........这里部分代码省略.........
// extension thereof.
GenericParamList *dcGenericParams = nullptr;
if (auto nominal = dyn_cast<NominalTypeDecl>(DC))
dcGenericParams = nominal->getGenericParams();
else if (auto ext = dyn_cast<ExtensionDecl>(DC))
dcGenericParams = ext->getGenericParams();
if (dcGenericParams) {
namelookup::FindLocalVal localVal(SM, Loc, Consumer);
localVal.checkGenericParams(dcGenericParams);
if (!Results.empty())
return;
}
}
DC = DC->getParent();
}
if (!isCascadingUse.hasValue())
isCascadingUse = true;
}
if (auto SF = dyn_cast<SourceFile>(DC)) {
if (Loc.isValid()) {
// Look for local variables in top-level code; normally, the parser
// resolves these for us, but it can't do the right thing for
// local types.
namelookup::FindLocalVal localVal(SM, Loc, Consumer);
localVal.checkSourceFile(*SF);
if (!Results.empty())
return;
}
}
// TODO: Does the debugger client care about compound names?
if (Name.isSimpleName()
&& DebugClient && DebugClient->lookupOverrides(Name.getBaseName(), DC,
Loc, IsTypeLookup, Results))
return;
recordLookupOfTopLevelName(DC, Name, isCascadingUse.getValue());
// Add private imports to the extra search list.
SmallVector<Module::ImportedModule, 8> extraImports;
if (auto FU = dyn_cast<FileUnit>(DC))
FU->getImportedModules(extraImports, Module::ImportFilter::Private);
using namespace namelookup;
SmallVector<ValueDecl *, 8> CurModuleResults;
auto resolutionKind =
IsTypeLookup ? ResolutionKind::TypesOnly : ResolutionKind::Overloadable;
lookupInModule(&M, {}, Name, CurModuleResults, NLKind::UnqualifiedLookup,
resolutionKind, TypeResolver, DC, extraImports);
for (auto VD : CurModuleResults)
Results.push_back(UnqualifiedLookupResult(VD));
if (DebugClient)
filterForDiscriminator(Results, DebugClient);
// Now add any names the DebugClient knows about to the lookup.
if (Name.isSimpleName() && DebugClient)
DebugClient->lookupAdditions(Name.getBaseName(), DC, Loc, IsTypeLookup,
Results);
// If we've found something, we're done.
if (!Results.empty())
return;
// If we still haven't found anything, but we do have some
// declarations that are "unavailable in the current Swift", drop
// those in.
if (!UnavailableInnerResults.empty()) {
Results = std::move(UnavailableInnerResults);
return;
}
if (!Name.isSimpleName())
return;
// Look for a module with the given name.
if (Name.isSimpleName(M.getName())) {
Results.push_back(UnqualifiedLookupResult(&M));
return;
}
Module *desiredModule = Ctx.getLoadedModule(Name.getBaseName());
if (!desiredModule && Name == Ctx.TheBuiltinModule->getName())
desiredModule = Ctx.TheBuiltinModule;
if (desiredModule) {
forAllVisibleModules(DC, [&](const Module::ImportedModule &import) -> bool {
if (import.second == desiredModule) {
Results.push_back(UnqualifiedLookupResult(import.second));
return false;
}
return true;
});
}
}