]> granicus.if.org Git - clang/commitdiff
Eliminate the internal command-line option for viewing inheritance in C++ classes...
authorDouglas Gregor <dgregor@apple.com>
Thu, 17 Feb 2011 19:04:40 +0000 (19:04 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 17 Feb 2011 19:04:40 +0000 (19:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125762 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/CC1Options.td
include/clang/Frontend/ASTConsumers.h
include/clang/Frontend/FrontendActions.h
include/clang/Frontend/FrontendOptions.h
lib/Frontend/ASTConsumers.cpp
lib/Frontend/CompilerInvocation.cpp
lib/Frontend/FrontendActions.cpp
lib/FrontendTool/ExecuteCompilerInvocation.cpp

index 34399770b85524620c32697b41e6ee13d60a72e3..f2a66e3ce9f1fcccc63154469742b205a3c3f25d 100644 (file)
@@ -302,9 +302,6 @@ def help : Flag<"-help">,
   HelpText<"Print this help text">;
 def _help : Flag<"--help">, Alias<help>;
 def x : Separate<"-x">, HelpText<"Input language type">;
-def cxx_inheritance_view : Separate<"-cxx-inheritance-view">,
-  MetaVarName<"<class name>">,
-  HelpText<"View C++ inheritance for a specified class">;
 def o : Separate<"-o">, MetaVarName<"<path>">, HelpText<"Specify output file">;
 def load : Separate<"-load">, MetaVarName<"<dsopath>">,
   HelpText<"Load the named plugin (dynamic shared object)">;
index 6757a27ed1f125a060c0dceeb9d2db160cde964b..e2071df8e32cd10e0e1aa3cb2cd44ef52a8a8ffe 100644 (file)
@@ -61,10 +61,6 @@ ASTConsumer *CreateASTViewer();
 // to stderr; this is intended for debugging.
 ASTConsumer *CreateDeclContextPrinter();
 
-// Inheritance viewer: for C++ code, creates a graph of the inheritance
-// tree for the given class and displays it with "dotty".
-ASTConsumer *CreateInheritanceViewer(const std::string& clsname);
-
 } // end clang namespace
 
 #endif
index 0f2637fa51a3d11cb6789c74ae4a65d7f3adb984..4df2e71571f78b9a5ed75c3ea398a58cc09c0f54 100644 (file)
@@ -94,12 +94,6 @@ public:
                                           bool &Chaining);
 };
 
-class InheritanceViewAction : public ASTFrontendAction {
-protected:
-  virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
-                                         llvm::StringRef InFile);
-};
-
 class SyntaxOnlyAction : public ASTFrontendAction {
 protected:
   virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
index f19914ecd78d9e8be0c741e9131c7cdcab133b80..19d39c3ca1b22e7c2c6953290b236af67c64a016 100644 (file)
@@ -39,7 +39,6 @@ namespace frontend {
     FixIt,                  ///< Parse and apply any fixits to the source.
     GeneratePCH,            ///< Generate pre-compiled header.
     GeneratePTH,            ///< Generate pre-tokenized header.
-    InheritanceView,        ///< View C++ inheritance for a specified class.
     InitOnly,               ///< Only execute frontend initialization.
     ParseSyntaxOnly,        ///< Parse and perform semantic analysis.
     PluginAction,           ///< Run a plugin action, \see ActionName.
@@ -85,9 +84,6 @@ public:
   /// The output file, if any.
   std::string OutputFile;
 
-  /// If given, the name for a C++ class to view the inheritance of.
-  std::string ViewClassInheritance;
-
   /// If given, the new suffix for fix-it rewritten files.
   std::string FixItSuffix;
 
index e029d8d85edab65aa4dee551f9cbab7c26cee63e..e86f99a28212ff861fe3cb5a48b1ed46c24a879a 100644 (file)
@@ -427,34 +427,6 @@ ASTConsumer *clang::CreateDeclContextPrinter() {
   return new DeclContextPrinter();
 }
 
-//===----------------------------------------------------------------------===//
-/// InheritanceViewer - C++ Inheritance Visualization
-
-namespace {
-class InheritanceViewer : public ASTConsumer {
-  const std::string clsname;
-public:
-  InheritanceViewer(const std::string& cname) : clsname(cname) {}
-
-  void HandleTranslationUnit(ASTContext &C) {
-    for (ASTContext::type_iterator I=C.types_begin(),E=C.types_end(); I!=E; ++I)
-      if (RecordType *T = dyn_cast<RecordType>(*I)) {
-        if (CXXRecordDecl *D = dyn_cast<CXXRecordDecl>(T->getDecl())) {
-          // FIXME: This lookup needs to be generalized to handle namespaces and
-          // (when we support them) templates.
-          if (D->getNameAsString() == clsname) {
-            D->viewInheritance(C);
-          }
-        }
-      }
-  }
-};
-}
-
-ASTConsumer *clang::CreateInheritanceViewer(const std::string& clsname) {
-  return new InheritanceViewer(clsname);
-}
-
 //===----------------------------------------------------------------------===//
 /// ASTDumperXML - In-depth XML dumping.
 
index fa65c619a78dc2ba472a663219808a8b490780fe..4bc67317ab9d358e60697ae0c6765589c1deeca1 100644 (file)
@@ -335,7 +335,6 @@ static const char *getInputKindName(InputKind Kind) {
 static const char *getActionName(frontend::ActionKind Kind) {
   switch (Kind) {
   case frontend::PluginAction:
-  case frontend::InheritanceView:
     llvm_unreachable("Invalid kind!");
 
   case frontend::ASTDump:                return "-ast-dump";
@@ -425,18 +424,13 @@ static void FrontendOptsToArgs(const FrontendOptions &Opts,
     Res.push_back("-o");
     Res.push_back(Opts.OutputFile);
   }
-  if (!Opts.ViewClassInheritance.empty()) {
-    Res.push_back("-cxx-inheritance-view");
-    Res.push_back(Opts.ViewClassInheritance);
-  }
   if (!Opts.CodeCompletionAt.FileName.empty()) {
     Res.push_back("-code-completion-at");
     Res.push_back(Opts.CodeCompletionAt.FileName + ":" +
                   llvm::utostr(Opts.CodeCompletionAt.Line) + ":" +
                   llvm::utostr(Opts.CodeCompletionAt.Column));
   }
-  if (Opts.ProgramAction != frontend::InheritanceView &&
-      Opts.ProgramAction != frontend::PluginAction)
+  if (Opts.ProgramAction != frontend::PluginAction)
     Res.push_back(getActionName(Opts.ProgramAction));
   if (!Opts.ActionName.empty()) {
     Res.push_back("-plugin");
@@ -1170,7 +1164,6 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
   Opts.ShowStats = Args.hasArg(OPT_print_stats);
   Opts.ShowTimers = Args.hasArg(OPT_ftime_report);
   Opts.ShowVersion = Args.hasArg(OPT_version);
-  Opts.ViewClassInheritance = Args.getLastArgValue(OPT_cxx_inheritance_view);
   Opts.ASTMergeFiles = Args.getAllArgValues(OPT_ast_merge);
   Opts.LLVMArgs = Args.getAllArgValues(OPT_mllvm);
   Opts.FixWhatYouCan = Args.hasArg(OPT_fix_what_you_can);
index e454321c0cce48d74363616fdb6be9abaa1d7390..d8e7d2904500f8397d71cb33226c73f7a141c181 100644 (file)
@@ -119,11 +119,6 @@ bool GeneratePCHAction::ComputeASTConsumerArguments(CompilerInstance &CI,
   return false;
 }
 
-ASTConsumer *InheritanceViewAction::CreateASTConsumer(CompilerInstance &CI,
-                                                      llvm::StringRef InFile) {
-  return CreateInheritanceViewer(CI.getFrontendOpts().ViewClassInheritance);
-}
-
 ASTConsumer *SyntaxOnlyAction::CreateASTConsumer(CompilerInstance &CI,
                                                  llvm::StringRef InFile) {
   return new ASTConsumer();
index dc8b15d9c5e134473be33ec16aed05327dceb99b..4bb85e7e6340bd6fedc876d429f352f94b00dfcf 100644 (file)
@@ -53,7 +53,6 @@ static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
   case FixIt:                  return new FixItAction();
   case GeneratePCH:            return new GeneratePCHAction();
   case GeneratePTH:            return new GeneratePTHAction();
-  case InheritanceView:        return new InheritanceViewAction();
   case InitOnly:               return new InitOnlyAction();
   case ParseSyntaxOnly:        return new SyntaxOnlyAction();