本文整理汇总了C++中llvm::SmallPtrSet::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ SmallPtrSet::push_back方法的具体用法?C++ SmallPtrSet::push_back怎么用?C++ SmallPtrSet::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类llvm::SmallPtrSet
的用法示例。
在下文中一共展示了SmallPtrSet::push_back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Type
/// Add the requirements for the given potential archetype and its nested
/// potential archetypes to the set of requirements.
static void
addRequirements(
Module &mod, Type type,
ArchetypeBuilder::PotentialArchetype *pa,
llvm::SmallPtrSet<ArchetypeBuilder::PotentialArchetype *, 16> &knownPAs,
SmallVectorImpl<Requirement> &requirements) {
// If the potential archetype has been bound away to a concrete type,
// it needs no requirements.
if (pa->isConcreteType())
return;
// Add a value witness marker.
requirements.push_back(Requirement(RequirementKind::WitnessMarker,
type, Type()));
// Add superclass requirement, if needed.
if (auto superclass = pa->getSuperclass()) {
// FIXME: Distinguish superclass from conformance?
// FIXME: What if the superclass type involves a type parameter?
requirements.push_back(Requirement(RequirementKind::Conformance,
type, superclass));
}
// Add conformance requirements.
SmallVector<ProtocolDecl *, 4> protocols;
for (const auto &conforms : pa->getConformsTo()) {
protocols.push_back(conforms.first);
}
ProtocolType::canonicalizeProtocols(protocols);
for (auto proto : protocols) {
requirements.push_back(Requirement(RequirementKind::Conformance,
type, proto->getDeclaredType()));
}
}