Skip to content

Commit

Permalink
[NFC] [Serialization] Remove unused output parameter 'Imported' in Re…
Browse files Browse the repository at this point in the history
…adAST
  • Loading branch information
ChuanqiXu9 committed Sep 7, 2023
1 parent b6e19b3 commit f0cd9b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
9 changes: 2 additions & 7 deletions clang/include/clang/Serialization/ASTReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ class ASTReader
/// Sema tracks these to emit deferred diags.
llvm::SmallSetVector<serialization::DeclID, 4> DeclsToCheckForDeferredDiags;

public:
private:
struct ImportedSubmodule {
serialization::SubmoduleID ID;
SourceLocation ImportLoc;
Expand All @@ -948,7 +948,6 @@ class ASTReader
: ID(ID), ImportLoc(ImportLoc) {}
};

private:
/// A list of modules that were imported by precompiled headers or
/// any other non-module AST file and have not yet been made visible. If a
/// module is made visible in the ASTReader, it will be transfered to
Expand Down Expand Up @@ -1633,13 +1632,9 @@ class ASTReader
/// \param ClientLoadCapabilities The set of client load-failure
/// capabilities, represented as a bitset of the enumerators of
/// LoadFailureCapabilities.
///
/// \param Imported optional out-parameter to append the list of modules
/// that were imported by precompiled headers or any other non-module AST file
ASTReadResult ReadAST(StringRef FileName, ModuleKind Type,
SourceLocation ImportLoc,
unsigned ClientLoadCapabilities,
SmallVectorImpl<ImportedSubmodule> *Imported = nullptr);
unsigned ClientLoadCapabilities);

/// Make the entities in the given module and any of its (non-explicit)
/// submodules visible to name lookup.
Expand Down
7 changes: 1 addition & 6 deletions clang/lib/Serialization/ASTReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4314,8 +4314,7 @@ static bool SkipCursorToBlock(BitstreamCursor &Cursor, unsigned BlockID) {
ASTReader::ASTReadResult ASTReader::ReadAST(StringRef FileName,
ModuleKind Type,
SourceLocation ImportLoc,
unsigned ClientLoadCapabilities,
SmallVectorImpl<ImportedSubmodule> *Imported) {
unsigned ClientLoadCapabilities) {
llvm::TimeTraceScope scope("ReadAST", FileName);

llvm::SaveAndRestore SetCurImportLocRAII(CurrentImportLoc, ImportLoc);
Expand Down Expand Up @@ -4506,10 +4505,6 @@ ASTReader::ASTReadResult ASTReader::ReadAST(StringRef FileName,
}
UnresolvedModuleRefs.clear();

if (Imported)
Imported->append(PendingImportedModules.begin(),
PendingImportedModules.end());

// FIXME: How do we load the 'use'd modules? They may not be submodules.
// Might be unnecessary as use declarations are only used to build the
// module itself.
Expand Down

0 comments on commit f0cd9b2

Please sign in to comment.