Skip to content

Commit e7e4caf

Browse files
authored
[clang] Rename overloaded virtual member function to prevent shadowing, NFCI (llvm#157501)
Resolves warnings triggered by `Woverloaded-virtual`
1 parent ff33c3b commit e7e4caf

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

clang/include/clang/Serialization/ASTReader.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,16 @@ class ASTReaderListener {
246246
return true;
247247
}
248248

249-
/// Overloaded member function of \c visitInputFile that should
250-
/// be defined when there is a distinction between
251-
/// the file name and name-as-requested. For example, when deserializing input
249+
/// Similiar to member function of \c visitInputFile but should
250+
/// be defined when there is a distinction between the file name
251+
/// and the name-as-requested. For example, when deserializing input
252252
/// files from precompiled AST files.
253253
///
254254
/// \returns true to continue receiving the next input file, false to stop.
255-
virtual bool visitInputFile(StringRef FilenameAsRequested, StringRef Filename,
256-
bool isSystem, bool isOverridden,
257-
bool isExplicitModule) {
255+
virtual bool visitInputFileAsRequested(StringRef FilenameAsRequested,
256+
StringRef Filename, bool isSystem,
257+
bool isOverridden,
258+
bool isExplicitModule) {
258259
return true;
259260
}
260261

clang/lib/Frontend/FrontendActions.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,10 @@ namespace {
796796
/// Indicates that the AST file contains particular input file.
797797
///
798798
/// \returns true to continue receiving the next input file, false to stop.
799-
bool visitInputFile(StringRef FilenameAsRequested, StringRef Filename,
800-
bool isSystem, bool isOverridden,
801-
bool isExplicitModule) override {
799+
bool visitInputFileAsRequested(StringRef FilenameAsRequested,
800+
StringRef Filename, bool isSystem,
801+
bool isOverridden,
802+
bool isExplicitModule) override {
802803

803804
Out.indent(2) << "Input file: " << FilenameAsRequested;
804805

clang/lib/Serialization/ASTReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5987,7 +5987,7 @@ bool ASTReader::readASTFileControlBlock(
59875987
AdditionalPathBuf, UnresolvedFilename, ModuleDir);
59885988
Filename = *FilenameBuf;
59895989
}
5990-
shouldContinue = Listener.visitInputFile(
5990+
shouldContinue = Listener.visitInputFileAsRequested(
59915991
*FilenameAsRequestedBuf, Filename, isSystemFile, Overridden,
59925992
/*IsExplicitModule=*/false);
59935993
break;

clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,10 @@ class PrebuiltModuleListener : public ASTReaderListener {
127127
/// For each input file discovered, check whether it's external path is in a
128128
/// stable directory. Traversal is stopped if the current module is not
129129
/// considered stable.
130-
bool visitInputFile(StringRef FilenameAsRequested, StringRef Filename,
131-
bool isSystem, bool isOverridden,
132-
bool isExplicitModule) override {
130+
bool visitInputFileAsRequested(StringRef FilenameAsRequested,
131+
StringRef Filename, bool isSystem,
132+
bool isOverridden,
133+
bool isExplicitModule) override {
133134
if (StableDirs.empty())
134135
return false;
135136
auto PrebuiltEntryIt = PrebuiltModulesASTMap.find(CurrentFile);

0 commit comments

Comments
 (0)