mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user