mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Enable specific-decl imports.
Note that the import kind is not checked yet; this is effectively our old behavior for "import swift.print". Infrastructure: move Module::forAllVisibleModules out-of-line, and add makeStackLambda to STLExtras for using a non-escaping lambda with std::function. Swift SVN r6852
This commit is contained in:
@@ -28,24 +28,6 @@ static constexpr const auto AF_DontPopBlockAtEnd =
|
||||
|
||||
using ConformancePair = std::pair<ProtocolDecl *, ProtocolConformance *>;
|
||||
|
||||
/// Declares a member \c type that is a std::function compatible with the given
|
||||
/// callable type.
|
||||
///
|
||||
/// \tparam T A callable type, such as a lambda.
|
||||
template <typename T>
|
||||
struct as_function : public as_function<decltype(&T::operator())> {};
|
||||
|
||||
template <typename L, typename R, typename... Args>
|
||||
struct as_function<R(L::*)(Args...) const> {
|
||||
using type = std::function<R(Args...)>;
|
||||
};
|
||||
|
||||
/// Returns a std::function that can call a void-returning, single-argument
|
||||
/// lambda without copying it.
|
||||
template <typename L>
|
||||
static typename as_function<L>::type makeStackLambda(const L &theLambda) {
|
||||
return std::cref(theLambda);
|
||||
}
|
||||
|
||||
static ModuleStatus
|
||||
validateControlBlock(llvm::BitstreamCursor &cursor,
|
||||
|
||||
Reference in New Issue
Block a user