@@ -106,7 +106,7 @@ class ASTUnit {
106106 };
107107
108108private:
109- std::shared_ptr <LangOptions> LangOpts;
109+ std::unique_ptr <LangOptions> LangOpts;
110110 IntrusiveRefCntPtr<DiagnosticsEngine> Diagnostics;
111111 IntrusiveRefCntPtr<FileManager> FileMgr;
112112 IntrusiveRefCntPtr<SourceManager> SourceMgr;
@@ -698,19 +698,17 @@ class ASTUnit {
698698 // / lifetime is expected to extend past that of the returned ASTUnit.
699699 // /
700700 // / \returns - The initialized ASTUnit or null if the AST failed to load.
701- static std::unique_ptr<ASTUnit>
702- LoadFromASTFile (StringRef Filename, const PCHContainerReader &PCHContainerRdr,
703- WhatToLoad ToLoad,
704- IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
705- const FileSystemOptions &FileSystemOpts,
706- const HeaderSearchOptions &HSOpts,
707- std::shared_ptr<LangOptions> LangOpts = nullptr ,
708- bool OnlyLocalDecls = false ,
709- CaptureDiagsKind CaptureDiagnostics = CaptureDiagsKind::None,
710- bool AllowASTWithCompilerErrors = false ,
711- bool UserFilesAreVolatile = false ,
712- IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS =
713- llvm::vfs::getRealFileSystem ());
701+ static std::unique_ptr<ASTUnit> LoadFromASTFile (
702+ StringRef Filename, const PCHContainerReader &PCHContainerRdr,
703+ WhatToLoad ToLoad, IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
704+ const FileSystemOptions &FileSystemOpts,
705+ const HeaderSearchOptions &HSOpts, const LangOptions *LangOpts = nullptr ,
706+ bool OnlyLocalDecls = false ,
707+ CaptureDiagsKind CaptureDiagnostics = CaptureDiagsKind::None,
708+ bool AllowASTWithCompilerErrors = false ,
709+ bool UserFilesAreVolatile = false ,
710+ IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS =
711+ llvm::vfs::getRealFileSystem ());
714712
715713private:
716714 // / Helper function for \c LoadFromCompilerInvocation() and
0 commit comments