T *const does not prevent logically non-const accesses to the underlying data, it merely indicates that the pointer value itself is const. This modifier can be cast off by a copy, so it's not generally what you want here. Switch to const T * instead.
Strip mention of the SourceFile. Any FileUnit-esque thing that can provide top-level decls and `lookupClassMembers` works here - especially a ModuleDecl.