Skip to content

Commit c3ff993

Browse files
committed
Remove RemappedFiles param from ASTUnit::LoadFromASTFile, NFC
This parameter is always set to `None`. Remove it. Differential Revision: https://reviews.llvm.org/D90889
1 parent 4eedc2e commit c3ff993

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

clang/include/clang/Frontend/ASTUnit.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -688,14 +688,15 @@ class ASTUnit {
688688
/// lifetime is expected to extend past that of the returned ASTUnit.
689689
///
690690
/// \returns - The initialized ASTUnit or null if the AST failed to load.
691-
static std::unique_ptr<ASTUnit> LoadFromASTFile(
692-
const std::string &Filename, const PCHContainerReader &PCHContainerRdr,
693-
WhatToLoad ToLoad, IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
694-
const FileSystemOptions &FileSystemOpts, bool UseDebugInfo = false,
695-
bool OnlyLocalDecls = false, ArrayRef<RemappedFile> RemappedFiles = None,
696-
CaptureDiagsKind CaptureDiagnostics = CaptureDiagsKind::None,
697-
bool AllowASTWithCompilerErrors = false,
698-
bool UserFilesAreVolatile = false);
691+
static std::unique_ptr<ASTUnit>
692+
LoadFromASTFile(const std::string &Filename,
693+
const PCHContainerReader &PCHContainerRdr, WhatToLoad ToLoad,
694+
IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
695+
const FileSystemOptions &FileSystemOpts,
696+
bool UseDebugInfo = false, bool OnlyLocalDecls = false,
697+
CaptureDiagsKind CaptureDiagnostics = CaptureDiagsKind::None,
698+
bool AllowASTWithCompilerErrors = false,
699+
bool UserFilesAreVolatile = false);
699700

700701
private:
701702
/// Helper function for \c LoadFromCompilerInvocation() and

clang/lib/Frontend/ASTUnit.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -758,9 +758,8 @@ std::unique_ptr<ASTUnit> ASTUnit::LoadFromASTFile(
758758
const std::string &Filename, const PCHContainerReader &PCHContainerRdr,
759759
WhatToLoad ToLoad, IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
760760
const FileSystemOptions &FileSystemOpts, bool UseDebugInfo,
761-
bool OnlyLocalDecls, ArrayRef<RemappedFile> RemappedFiles,
762-
CaptureDiagsKind CaptureDiagnostics, bool AllowASTWithCompilerErrors,
763-
bool UserFilesAreVolatile) {
761+
bool OnlyLocalDecls, CaptureDiagsKind CaptureDiagnostics,
762+
bool AllowASTWithCompilerErrors, bool UserFilesAreVolatile) {
764763
std::unique_ptr<ASTUnit> AST(new ASTUnit(true));
765764

766765
// Recover resources if we crash before exiting this method.
@@ -793,9 +792,6 @@ std::unique_ptr<ASTUnit> ASTUnit::LoadFromASTFile(
793792
/*Target=*/nullptr));
794793
AST->PPOpts = std::make_shared<PreprocessorOptions>();
795794

796-
for (const auto &RemappedFile : RemappedFiles)
797-
AST->PPOpts->addRemappedFile(RemappedFile.first, RemappedFile.second);
798-
799795
// Gather Info for preprocessor construction later on.
800796

801797
HeaderSearch &HeaderInfo = *AST->HeaderInfo;

clang/tools/c-index-test/core_main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ static bool printSourceSymbolsFromModule(StringRef modulePath,
262262
std::unique_ptr<ASTUnit> AU = ASTUnit::LoadFromASTFile(
263263
std::string(modulePath), *pchRdr, ASTUnit::LoadASTOnly, Diags,
264264
FileSystemOpts, /*UseDebugInfo=*/false,
265-
/*OnlyLocalDecls=*/true, None, CaptureDiagsKind::None,
265+
/*OnlyLocalDecls=*/true, CaptureDiagsKind::None,
266266
/*AllowASTWithCompilerErrors=*/true,
267267
/*UserFilesAreVolatile=*/false);
268268
if (!AU) {

clang/tools/libclang/CIndex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3475,7 +3475,7 @@ enum CXErrorCode clang_createTranslationUnit2(CXIndex CIdx,
34753475
std::unique_ptr<ASTUnit> AU = ASTUnit::LoadFromASTFile(
34763476
ast_filename, CXXIdx->getPCHContainerOperations()->getRawReader(),
34773477
ASTUnit::LoadEverything, Diags, FileSystemOpts, /*UseDebugInfo=*/false,
3478-
CXXIdx->getOnlyLocalDecls(), None, CaptureDiagsKind::All,
3478+
CXXIdx->getOnlyLocalDecls(), CaptureDiagsKind::All,
34793479
/*AllowASTWithCompilerErrors=*/true,
34803480
/*UserFilesAreVolatile=*/true);
34813481
*out_TU = MakeCXTranslationUnit(CXXIdx, std::move(AU));

0 commit comments

Comments
 (0)