diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-02-17 19:04:40 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-02-17 19:04:40 +0000 |
commit | 91a230a15f2aca8f6a8b7fd492525ec372a98e6b (patch) | |
tree | 9e34a7c014edde01ff7beb1c53c6680a6abe8878 /lib/Frontend | |
parent | cf0b2d83666804b377dbe05370a5c9b9bafaaa5a (diff) |
Eliminate the internal command-line option for viewing inheritance in C++ classes, since it's only really worked for the trivial cases anyway due to lame pseudo-parsing of the class name. The viewInheritance() function is still available for use in the debugger, where this is far more useful
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125762 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/ASTConsumers.cpp | 28 | ||||
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 9 | ||||
-rw-r--r-- | lib/Frontend/FrontendActions.cpp | 5 |
3 files changed, 1 insertions, 41 deletions
diff --git a/lib/Frontend/ASTConsumers.cpp b/lib/Frontend/ASTConsumers.cpp index e029d8d85e..e86f99a282 100644 --- a/lib/Frontend/ASTConsumers.cpp +++ b/lib/Frontend/ASTConsumers.cpp @@ -428,34 +428,6 @@ ASTConsumer *clang::CreateDeclContextPrinter() { } //===----------------------------------------------------------------------===// -/// 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. namespace { diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index fa65c619a7..4bc67317ab 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -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); diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp index e454321c0c..d8e7d29045 100644 --- a/lib/Frontend/FrontendActions.cpp +++ b/lib/Frontend/FrontendActions.cpp @@ -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(); |