Skip to content

Commit ec17976

Browse files
author
David Ungar
committed
Cosmetics.
1 parent 0e10944 commit ec17976

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

include/swift/AST/ASTContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ class ASTContext final {
942942
return !LangOpts.EnableAccessControl;
943943
}
944944

945-
/// Logically, there is a separate cache for each SourceFile.
945+
/// Each kind and SourceFile has its own cache for a Type.
946946
Type &getDefaultTypeRequestCache(SourceFile *, KnownProtocolKind);
947947

948948
private:

include/swift/AST/DeclContext.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -784,11 +784,10 @@ class IterableDeclContext {
784784
template <typename ParamT, typename = typename std::enable_if<
785785
std::is_same<ParamT, DeclContext>::value>::type>
786786
void simple_display(llvm::raw_ostream &out, const ParamT *dc) {
787-
if (!dc) {
787+
if (dc)
788+
dc->printContext(out, 0, true);
789+
else
788790
out << "(null)";
789-
return;
790-
}
791-
dc->printContext(out, 0, true);
792791
}
793792

794793
} // end namespace swift

lib/AST/ASTContext.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,8 @@ FOR_KNOWN_FOUNDATION_TYPES(CACHE_FOUNDATION_DECL)
292292

293293
/// Caches of default types for DefaultTypeRequest.
294294
/// Used to be instance variables in the TypeChecker.
295-
/// There is a logically separate cache for each SourceFile.
295+
/// There is a logically separate cache for each SourceFile and
296+
/// KnownProtocolKind.
296297
llvm::DenseMap<SourceFile *, std::array<Type, NumKnownProtocols>>
297298
DefaultTypeRequestCaches;
298299

0 commit comments

Comments
 (0)