[clang] 1df10f1 - [Frontend] Remove ShowIncludesPretendHeader

Shoaib Meenai via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 21 15:50:01 PDT 2023


Author: Shoaib Meenai
Date: 2023-06-21T15:48:28-07:00
New Revision: 1df10f15807f9b7deba3f714d27e21578a8b4748

URL: https://github.com/llvm/llvm-project/commit/1df10f15807f9b7deba3f714d27e21578a8b4748
DIFF: https://github.com/llvm/llvm-project/commit/1df10f15807f9b7deba3f714d27e21578a8b4748.diff

LOG: [Frontend] Remove ShowIncludesPretendHeader

It hasn't been written to since https://reviews.llvm.org/D46652, so it
was always empty. I don't have enough context on that diff to know if
the removal of the write to ShowIncludesPretendHeader in that diff was
intentional, but no one's complained about it for five years, so I
assume we're okay to just get rid of it entirely.

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D153176

Added: 
    

Modified: 
    clang/include/clang/Frontend/DependencyOutputOptions.h
    clang/lib/Frontend/HeaderIncludeGen.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Frontend/DependencyOutputOptions.h b/clang/include/clang/Frontend/DependencyOutputOptions.h
index e140ff9baa117..e4b26d92647d0 100644
--- a/clang/include/clang/Frontend/DependencyOutputOptions.h
+++ b/clang/include/clang/Frontend/DependencyOutputOptions.h
@@ -76,9 +76,6 @@ class DependencyOutputOptions {
   /// target.
   std::vector<std::pair<std::string, ExtraDepKind>> ExtraDeps;
 
-  /// In /showIncludes mode, pretend the main TU is a header with this name.
-  std::string ShowIncludesPretendHeader;
-
   /// The file to write GraphViz-formatted header dependencies to.
   std::string DOTOutputFile;
 

diff  --git a/clang/lib/Frontend/HeaderIncludeGen.cpp b/clang/lib/Frontend/HeaderIncludeGen.cpp
index 27cd8b701a975..9ada227d42d62 100644
--- a/clang/lib/Frontend/HeaderIncludeGen.cpp
+++ b/clang/lib/Frontend/HeaderIncludeGen.cpp
@@ -214,13 +214,8 @@ void HeaderIncludesCallback::FileChanged(SourceLocation Loc,
 
     // We track when we are done with the predefines by watching for the first
     // place where we drop back to a nesting depth of 1.
-    if (CurrentIncludeDepth == 1 && !HasProcessedPredefines) {
-      if (!DepOpts.ShowIncludesPretendHeader.empty()) {
-        PrintHeaderInfo(OutputFile, DepOpts.ShowIncludesPretendHeader,
-                        ShowDepth, 2, MSStyle);
-      }
+    if (CurrentIncludeDepth == 1 && !HasProcessedPredefines)
       HasProcessedPredefines = true;
-    }
 
     return;
   } else {
@@ -233,8 +228,6 @@ void HeaderIncludesCallback::FileChanged(SourceLocation Loc,
   unsigned IncludeDepth = CurrentIncludeDepth;
   if (!HasProcessedPredefines)
     --IncludeDepth; // Ignore indent from <built-in>.
-  else if (!DepOpts.ShowIncludesPretendHeader.empty())
-    ++IncludeDepth; // Pretend inclusion by ShowIncludesPretendHeader.
 
   // FIXME: Identify headers in a more robust way than comparing their name to
   // "<command line>" and "<built-in>" in a bunch of places.


        


More information about the cfe-commits mailing list