Index: clang/include/clang/Frontend/ASTUnit.h =================================================================== --- clang/include/clang/Frontend/ASTUnit.h +++ clang/include/clang/Frontend/ASTUnit.h @@ -688,14 +688,15 @@ /// lifetime is expected to extend past that of the returned ASTUnit. /// /// \returns - The initialized ASTUnit or null if the AST failed to load. - static std::unique_ptr LoadFromASTFile( - const std::string &Filename, const PCHContainerReader &PCHContainerRdr, - WhatToLoad ToLoad, IntrusiveRefCntPtr Diags, - const FileSystemOptions &FileSystemOpts, bool UseDebugInfo = false, - bool OnlyLocalDecls = false, ArrayRef RemappedFiles = None, - CaptureDiagsKind CaptureDiagnostics = CaptureDiagsKind::None, - bool AllowPCHWithCompilerErrors = false, - bool UserFilesAreVolatile = false); + static std::unique_ptr + LoadFromASTFile(const std::string &Filename, + const PCHContainerReader &PCHContainerRdr, WhatToLoad ToLoad, + IntrusiveRefCntPtr Diags, + const FileSystemOptions &FileSystemOpts, + bool UseDebugInfo = false, bool OnlyLocalDecls = false, + CaptureDiagsKind CaptureDiagnostics = CaptureDiagsKind::None, + bool AllowPCHWithCompilerErrors = false, + bool UserFilesAreVolatile = false); private: /// Helper function for \c LoadFromCompilerInvocation() and Index: clang/lib/Frontend/ASTUnit.cpp =================================================================== --- clang/lib/Frontend/ASTUnit.cpp +++ clang/lib/Frontend/ASTUnit.cpp @@ -758,9 +758,8 @@ const std::string &Filename, const PCHContainerReader &PCHContainerRdr, WhatToLoad ToLoad, IntrusiveRefCntPtr Diags, const FileSystemOptions &FileSystemOpts, bool UseDebugInfo, - bool OnlyLocalDecls, ArrayRef RemappedFiles, - CaptureDiagsKind CaptureDiagnostics, bool AllowPCHWithCompilerErrors, - bool UserFilesAreVolatile) { + bool OnlyLocalDecls, CaptureDiagsKind CaptureDiagnostics, + bool AllowPCHWithCompilerErrors, bool UserFilesAreVolatile) { std::unique_ptr AST(new ASTUnit(true)); // Recover resources if we crash before exiting this method. @@ -793,9 +792,6 @@ /*Target=*/nullptr)); AST->PPOpts = std::make_shared(); - for (const auto &RemappedFile : RemappedFiles) - AST->PPOpts->addRemappedFile(RemappedFile.first, RemappedFile.second); - // Gather Info for preprocessor construction later on. HeaderSearch &HeaderInfo = *AST->HeaderInfo; Index: clang/tools/c-index-test/core_main.cpp =================================================================== --- clang/tools/c-index-test/core_main.cpp +++ clang/tools/c-index-test/core_main.cpp @@ -262,7 +262,7 @@ std::unique_ptr AU = ASTUnit::LoadFromASTFile( std::string(modulePath), *pchRdr, ASTUnit::LoadASTOnly, Diags, FileSystemOpts, /*UseDebugInfo=*/false, - /*OnlyLocalDecls=*/true, None, CaptureDiagsKind::None, + /*OnlyLocalDecls=*/true, CaptureDiagsKind::None, /*AllowPCHWithCompilerErrors=*/true, /*UserFilesAreVolatile=*/false); if (!AU) { Index: clang/tools/libclang/CIndex.cpp =================================================================== --- clang/tools/libclang/CIndex.cpp +++ clang/tools/libclang/CIndex.cpp @@ -3475,7 +3475,7 @@ std::unique_ptr AU = ASTUnit::LoadFromASTFile( ast_filename, CXXIdx->getPCHContainerOperations()->getRawReader(), ASTUnit::LoadEverything, Diags, FileSystemOpts, /*UseDebugInfo=*/false, - CXXIdx->getOnlyLocalDecls(), None, CaptureDiagsKind::All, + CXXIdx->getOnlyLocalDecls(), CaptureDiagsKind::All, /*AllowPCHWithCompilerErrors=*/true, /*UserFilesAreVolatile=*/true); *out_TU = MakeCXTranslationUnit(CXXIdx, std::move(AU));