Skip to content

Conversation

@cyndyishida
Copy link
Member

Resolves warnings triggered by Woverloaded-virtual

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:modules C++20 modules and Clang Header Modules labels Sep 8, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 8, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-modules

Author: Cyndy Ishida (cyndyishida)

Changes

Resolves warnings triggered by Woverloaded-virtual


Full diff: https://github.com/llvm/llvm-project/pull/157501.diff

4 Files Affected:

  • (modified) clang/include/clang/Serialization/ASTReader.h (+7-6)
  • (modified) clang/lib/Frontend/FrontendActions.cpp (+4-3)
  • (modified) clang/lib/Serialization/ASTReader.cpp (+1-1)
  • (modified) clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp (+4-3)
diff --git a/clang/include/clang/Serialization/ASTReader.h b/clang/include/clang/Serialization/ASTReader.h
index 3ede0925676e8..af856a8097ab1 100644
--- a/clang/include/clang/Serialization/ASTReader.h
+++ b/clang/include/clang/Serialization/ASTReader.h
@@ -246,15 +246,16 @@ class ASTReaderListener {
     return true;
   }
 
-  /// Overloaded member function of \c visitInputFile that should
-  /// be defined when there is a distinction between
-  /// the file name and name-as-requested. For example, when deserializing input
+  /// Similiar to member function of \c visitInputFile but should
+  /// be defined when there is a distinction between the file name
+  /// and the name-as-requested. For example, when deserializing input
   /// files from precompiled AST files.
   ///
   /// \returns true to continue receiving the next input file, false to stop.
-  virtual bool visitInputFile(StringRef FilenameAsRequested, StringRef Filename,
-                              bool isSystem, bool isOverridden,
-                              bool isExplicitModule) {
+  virtual bool visitInputFileAsRequested(StringRef FilenameAsRequested,
+                                         StringRef Filename, bool isSystem,
+                                         bool isOverridden,
+                                         bool isExplicitModule) {
     return true;
   }
 
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index ccda2c4ce4b6d..f18318478d7a7 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -796,9 +796,10 @@ namespace {
     /// Indicates that the AST file contains particular input file.
     ///
     /// \returns true to continue receiving the next input file, false to stop.
-    bool visitInputFile(StringRef FilenameAsRequested, StringRef Filename,
-                        bool isSystem, bool isOverridden,
-                        bool isExplicitModule) override {
+    bool visitInputFileAsRequested(StringRef FilenameAsRequested,
+                                   StringRef Filename, bool isSystem,
+                                   bool isOverridden,
+                                   bool isExplicitModule) override {
 
       Out.indent(2) << "Input file: " << FilenameAsRequested;
 
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 9b0e699b1a829..1b3a8b13f1fb1 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -5987,7 +5987,7 @@ bool ASTReader::readASTFileControlBlock(
                 AdditionalPathBuf, UnresolvedFilename, ModuleDir);
             Filename = *FilenameBuf;
           }
-          shouldContinue = Listener.visitInputFile(
+          shouldContinue = Listener.visitInputFileAsRequested(
               *FilenameAsRequestedBuf, Filename, isSystemFile, Overridden,
               /*IsExplicitModule=*/false);
           break;
diff --git a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
index b2b61de790e8f..f32747ddf8183 100644
--- a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
+++ b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
@@ -127,9 +127,10 @@ class PrebuiltModuleListener : public ASTReaderListener {
   /// For each input file discovered, check whether it's external path is in a
   /// stable directory. Traversal is stopped if the current module is not
   /// considered stable.
-  bool visitInputFile(StringRef FilenameAsRequested, StringRef Filename,
-                      bool isSystem, bool isOverridden,
-                      bool isExplicitModule) override {
+  bool visitInputFileAsRequested(StringRef FilenameAsRequested,
+                                 StringRef Filename, bool isSystem,
+                                 bool isOverridden,
+                                 bool isExplicitModule) override {
     if (StableDirs.empty())
       return false;
     auto PrebuiltEntryIt = PrebuiltModulesASTMap.find(CurrentFile);

@cyndyishida cyndyishida merged commit e7e4caf into llvm:main Sep 8, 2025
12 checks passed
@cyndyishida cyndyishida deleted the fixGCCFailure branch September 8, 2025 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:modules C++20 modules and Clang Header Modules clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants