[sourcekit] Change getASTManager() to return shared_ptr

Addressing review feedback: this avoids calling shared_from_this() from
outside the implementation.  Note: it is not possible to use private
inheritance of enable_shared_from_this to prevent this issue in general,
because enabled_shared_from_this relies on the shared_ptr constructor
being able to detect that the type has this inheritance, which means it
must be public.
This commit is contained in:
Ben Langmuir
2018-09-25 16:42:41 -07:00
parent 2fbe270c6d
commit b04ffcca86
7 changed files with 20 additions and 20 deletions

View File

@@ -251,10 +251,10 @@ void SwiftLangSupport::indexSource(StringRef InputFile,
CompilerInvocation Invocation;
bool Failed = true;
if (IsModuleIndexing) {
Failed = getASTManager().initCompilerInvocationNoInputs(
Failed = getASTManager()->initCompilerInvocationNoInputs(
Invocation, Args, CI.getDiags(), Error);
} else {
Failed = getASTManager().initCompilerInvocation(
Failed = getASTManager()->initCompilerInvocation(
Invocation, Args, CI.getDiags(), InputFile, Error);
}
if (Failed) {