diff --git a/include/swift/AST/PrintOptions.h b/include/swift/AST/PrintOptions.h index 8fdfac5488e61..38611e1245b56 100644 --- a/include/swift/AST/PrintOptions.h +++ b/include/swift/AST/PrintOptions.h @@ -327,8 +327,7 @@ struct PrintOptions { }; /// Whether to print function @convention attribute on function types. - // FIXME: [clang-function-type-serialization] Once we start serializing Clang - // types, we should also start printing the full type in the swiftinterface. + // [TODO: Clang-type-plumbing] Print the full type in the swiftinterface. FunctionRepresentationMode PrintFunctionRepresentationAttrs = FunctionRepresentationMode::NameOnly; diff --git a/include/swift/AST/Types.h b/include/swift/AST/Types.h index 34b33dd64fcb9..7cff621fed9bc 100644 --- a/include/swift/AST/Types.h +++ b/include/swift/AST/Types.h @@ -3013,8 +3013,7 @@ class AnyFunctionType : public TypeBase { static void assertIsFunctionType(const clang::Type *); ExtInfo(unsigned Bits, Uncommon Other) : Bits(Bits), Other(Other) { - // TODO: [clang-function-type-serialization] Once we start serializing - // the Clang type, we should also assert that the pointer is non-null. + // [TODO: Clang-type-plumbing] Assert that the pointer is non-null. auto Rep = Representation(Bits & RepresentationMask); if ((Rep == Representation::CFunctionPointer) && Other.ClangFunctionType) assertIsFunctionType(Other.ClangFunctionType); @@ -4372,7 +4371,7 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode, unsigned NumAnyResults : 16; // Not including the ErrorResult. unsigned NumAnyIndirectFormalResults : 16; // Subset of NumAnyResults. - // [SILFunctionType-layout] + // [NOTE: SILFunctionType-layout] // The layout of a SILFunctionType in memory is: // SILFunctionType // SILParameterInfo[NumParameters] diff --git a/include/swift/Basic/LangOptions.h b/include/swift/Basic/LangOptions.h index 60a9099da2b96..c47c2e4f68dcb 100644 --- a/include/swift/Basic/LangOptions.h +++ b/include/swift/Basic/LangOptions.h @@ -274,8 +274,7 @@ namespace swift { /// Use Clang function types for computing canonical types. /// If this option is false, the clang function types will still be computed /// but will not be used for checking type equality. - /// FIXME: [clang-function-type-serialization] This option should be turned - /// on once we start serializing clang function types. + /// [TODO: Clang-type-plumbing] Turn on for feature rollout. bool UseClangFunctionTypes = false; /// Whether to use the import as member inference system diff --git a/include/swift/Frontend/ModuleInterfaceSupport.h b/include/swift/Frontend/ModuleInterfaceSupport.h index 4dfff6a0f7d6d..b7631304df3ff 100644 --- a/include/swift/Frontend/ModuleInterfaceSupport.h +++ b/include/swift/Frontend/ModuleInterfaceSupport.h @@ -33,7 +33,7 @@ struct ModuleInterfaceOptions { bool PreserveTypesAsWritten = false; /// Should we emit the cType when printing @convention(c) or no? - /// FIXME: [clang-function-type-serialization] This check should go away. + /// [TODO: Clang-type-plumbing] This check should go away. bool PrintFullConvention = false; /// Copy of all the command-line flags passed at .swiftinterface diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index bf3b609c68d30..cc831b87ab8c6 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -3453,7 +3453,7 @@ CanSILFunctionType SILFunctionType::get( // All SILFunctionTypes are canonical. - // See [SILFunctionType-layout] + // See [NOTE: SILFunctionType-layout] bool hasResultCache = normalResults.size() > 1; size_t bytes = totalSizeToAlloc { break; case SILFunctionType::Representation::CFunctionPointer: Printer << "c"; - // FIXME: [clang-function-type-serialization] Once we start serializing - // Clang function types, we should be able to remove the second check. + // [TODO: Clang-type-plumbing] Remove the second check. if (printNameOnly || !info.getUncommonInfo().hasValue()) break; printCType(Ctx, Printer, info); @@ -4086,8 +4085,7 @@ class TypePrinter : public TypeVisitor { break; case SILFunctionType::Representation::CFunctionPointer: Printer << "c"; - // FIXME: [clang-function-type-serialization] Once we start serializing - // Clang function types, we should be able to remove the second check. + // [TODO: Clang-type-plumbing] Remove the second check. if (printNameOnly || !info.getUncommonInfo().hasValue()) break; printCType(Ctx, Printer, info); diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index b3c693a3d6fa5..52a41bebaba8c 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -3407,7 +3407,7 @@ const clang::Type *AnyFunctionType::getCanonicalClangFunctionType() const { return ty ? ty->getCanonicalTypeInternal().getTypePtr() : nullptr; } -// TODO: [store-sil-clang-function-type] +// [TODO: Store-SIL-Clang-type] const clang::FunctionType *SILFunctionType::getClangFunctionType() const { return nullptr; } diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index ccc3cfe6027a2..3c0b4795901e1 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -3409,7 +3409,7 @@ void ClangModuleUnit::getImportedModules( if (filter.containsOnly(ModuleDecl::ImportFilterKind::ImplementationOnly)) return; - // [Note: Pure-Clang-modules-privately-import-stdlib]: + // [NOTE: Pure-Clang-modules-privately-import-stdlib]: // Needed for implicitly synthesized conformances. if (filter.contains(ModuleDecl::ImportFilterKind::Private)) if (auto stdlib = owner.getStdlibModule()) diff --git a/lib/Frontend/Frontend.cpp b/lib/Frontend/Frontend.cpp index da7f171f9ba4b..7e000a0b6a563 100644 --- a/lib/Frontend/Frontend.cpp +++ b/lib/Frontend/Frontend.cpp @@ -428,10 +428,10 @@ void CompilerInstance::setUpDiagnosticOptions() { // this modules was specified as an explicit input to the compiler. // 4. ModuleInterfaceLoader: Tries to find an up-to-date swiftmodule. If it // succeeds, it issues a particular "error" (see -// [Note: ModuleInterfaceLoader-defer-to-ImplicitSerializedModuleLoader]), which -// is interpreted by the overarching loader as a command to use the -// ImplicitSerializedModuleLoader. If we failed to find a .swiftmodule, this falls -// back to using an interface. Actual errors lead to diagnostics. +// [NOTE: ModuleInterfaceLoader-defer-to-ImplicitSerializedModuleLoader]), +// which is interpreted by the overarching loader as a command to use the +// ImplicitSerializedModuleLoader. If we failed to find a .swiftmodule, +// this falls back to using an interface. Actual errors lead to diagnostics. // 5. ImplicitSerializedModuleLoader: Loads a serialized module if it can. // Used for implicit loading of modules from the compiler's search paths. // 6. ClangImporter: This must come after all the Swift module loaders because diff --git a/lib/Frontend/ModuleInterfaceLoader.cpp b/lib/Frontend/ModuleInterfaceLoader.cpp index 67f08976273d6..9105626e8223a 100644 --- a/lib/Frontend/ModuleInterfaceLoader.cpp +++ b/lib/Frontend/ModuleInterfaceLoader.cpp @@ -613,7 +613,7 @@ class ModuleInterfaceLoaderImpl { case ModuleLoadingMode::OnlySerialized: llvm_unreachable("module interface loader should not have been created"); } - // [Note: ModuleInterfaceLoader-defer-to-SerializedModuleLoader] + // [NOTE: ModuleInterfaceLoader-defer-to-ImplicitSerializedModuleLoader] // If there's a module adjacent to the .swiftinterface that we can // _likely_ load (it validates OK and is up to date), bail early with // errc::not_supported, so the next (serialized) loader in the chain will diff --git a/lib/FrontendTool/FrontendTool.cpp b/lib/FrontendTool/FrontendTool.cpp index 05a30b45f6b44..2fc09de54087c 100644 --- a/lib/FrontendTool/FrontendTool.cpp +++ b/lib/FrontendTool/FrontendTool.cpp @@ -367,7 +367,7 @@ class ABIDependencyEvaluator { }; } // end anonymous namespace -// See [Note: Bailing-vs-crashing-in-trace-emission]. +// See [NOTE: Bailing-vs-crashing-in-trace-emission]. // TODO: Use PrettyStackTrace instead? void ABIDependencyEvaluator::crashOnInvariantViolation( llvm::function_ref f) const { @@ -380,7 +380,7 @@ void ABIDependencyEvaluator::crashOnInvariantViolation( #endif } -// [Note: Trace-Clang-submodule-complexity] +// [NOTE: Trace-Clang-submodule-complexity] // // A Clang module may have zero or more submodules. In practice, when traversing // the imports of a module, we observe that different submodules of the same @@ -393,7 +393,7 @@ void ABIDependencyEvaluator::crashOnInvariantViolation( // branches, so long as we don't try to visit an ancestor when one of its // descendants is still on the traversal stack, so that we don't end up with // arbitrarily complex intra-module cycles. -// See also: [Note: Intra-module-leafwards-traversal]. +// See also: [NOTE: Intra-module-leafwards-traversal]. // 2. When adding entries to the ABI export map, we need to avoid marking // dependencies within the same top-level module. This step is needed in // addition to step 1 to avoid creating cycles like @@ -421,7 +421,7 @@ void ABIDependencyEvaluator::reexposeImportedABI( && module->isNonSwiftModule() && module->getTopLevelModule() == reexport->getTopLevelModule()) { // Dependencies within the same top-level Clang module are not useful. - // See also: [Note: Trace-Clang-submodule-complexity]. + // See also: [NOTE: Trace-Clang-submodule-complexity]. return; } @@ -504,18 +504,18 @@ void ABIDependencyEvaluator::computeABIDependenciesForClangModule( // There are three cases here which can potentially create cycles: // // 1. Clang modules importing the stdlib. - // See [Note: Pure-Clang-modules-privately-import-stdlib]. + // See [NOTE: Pure-Clang-modules-privately-import-stdlib]. // 2. Overlay S @_exported-imports underlying module S' and another Clang // module C'. C' (transitively) #imports S' but it gets treated as if // C' imports S. This creates a cycle: S -> C' -> ... -> S. // In practice, this case is hit for // Darwin (Swift) -> SwiftOverlayShims (Clang) -> Darwin (Swift). - // 3. [Note: Intra-module-leafwards-traversal] + // 3. [NOTE: Intra-module-leafwards-traversal] // Cycles within the same top-level module. // These don't matter for us, since we only care about the dependency // graph at the granularity of top-level modules. So we ignore these // by only considering parent -> submodule dependencies. - // See also [Note: Trace-Clang-submodule-complexity]. + // See also [NOTE: Trace-Clang-submodule-complexity]. if (import->isStdlibModule()) { continue; } @@ -720,7 +720,7 @@ static void computeSwiftModuleTraceInfo( }); } -// [Note: Bailing-vs-crashing-in-trace-emission] There are certain edge cases +// [NOTE: Bailing-vs-crashing-in-trace-emission] There are certain edge cases // in trace emission where an invariant that you think should hold does not hold // in practice. For example, sometimes we have seen modules without any // corresponding filename. diff --git a/lib/Sema/TypeCheckType.cpp b/lib/Sema/TypeCheckType.cpp index f9b59d8462aaf..897a06a20b84d 100644 --- a/lib/Sema/TypeCheckType.cpp +++ b/lib/Sema/TypeCheckType.cpp @@ -2213,7 +2213,7 @@ Type TypeResolver::resolveAttributedType(TypeAttributes &attrs, } // Resolve the function type directly with these attributes. - // TODO: [store-sil-clang-function-type] + // [TODO: Store-SIL-Clang-type] SILFunctionType::ExtInfo extInfo(rep, attrs.has(TAK_pseudogeneric), attrs.has(TAK_noescape), diffKind, nullptr);