[cfe-commits] r90029 - in /cfe/trunk/tools/clang-cc: Options.cpp clang-cc.cpp

Kovarththanan Rajaratnam kovarththanan.rajaratnam at gmail.com
Fri Nov 27 23:52:34 PST 2009


Author: krj
Date: Sat Nov 28 01:52:34 2009
New Revision: 90029

URL: http://llvm.org/viewvc/llvm-project?rev=90029&view=rev
Log:
Move program actions implications to clang::InitializeFrontendOptions which already contains such logic.


Modified:
    cfe/trunk/tools/clang-cc/Options.cpp
    cfe/trunk/tools/clang-cc/clang-cc.cpp

Modified: cfe/trunk/tools/clang-cc/Options.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/Options.cpp?rev=90029&r1=90028&r2=90029&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/Options.cpp (original)
+++ cfe/trunk/tools/clang-cc/Options.cpp Sat Nov 28 01:52:34 2009
@@ -831,13 +831,8 @@
 void clang::InitializeFrontendOptions(FrontendOptions &Opts) {
   using namespace frontendoptions;
 
-  // Select program action.
   Opts.ProgramAction = ProgAction;
-  if (PluginActionName.getPosition()) {
-    Opts.ProgramAction = frontend::PluginAction;
-    Opts.ActionName = PluginActionName;
-  }
-
+  Opts.ActionName = PluginActionName;
   Opts.CodeCompletionAt = CodeCompletionAt;
   Opts.DebugCodeCompletionPrinter = !NoCodeCompletionDebugPrinter;
   Opts.DisableFree = DisableFree;
@@ -850,6 +845,14 @@
   Opts.ShowTimers = TimeReport;
   Opts.ViewClassInheritance = InheritanceViewCls;
 
+  // Enforce certain program action implications.
+  if (!Opts.ActionName.empty())
+    Opts.ProgramAction = frontend::PluginAction;
+  if (!Opts.ViewClassInheritance.empty())
+    Opts.ProgramAction = frontend::InheritanceView;
+  if (!Opts.FixItLocations.empty())
+    Opts.ProgramAction = frontend::FixIt;
+
   // '-' is the default input if none is given.
   if (InputFilenames.empty()) {
     FrontendOptions::InputKind IK = InputType;

Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=90029&r1=90028&r2=90029&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Sat Nov 28 01:52:34 2009
@@ -246,12 +246,6 @@
   if (Clang.getFrontendOpts().ShowTimers)
     ClangFrontendTimer = new llvm::Timer("Clang front-end time");
 
-  // Enforce certain implications.
-  if (!Clang.getFrontendOpts().ViewClassInheritance.empty())
-    Clang.getFrontendOpts().ProgramAction = frontend::InheritanceView;
-  if (!Clang.getFrontendOpts().FixItLocations.empty())
-    Clang.getFrontendOpts().ProgramAction = frontend::FixIt;
-
   for (unsigned i = 0, e = Clang.getFrontendOpts().Inputs.size(); i != e; ++i) {
     const std::string &InFile = Clang.getFrontendOpts().Inputs[i].second;
 





More information about the cfe-commits mailing list