[cfe-commits] r67679 - in /cfe/trunk: include/clang/Driver/Option.h lib/Driver/OptTable.cpp lib/Driver/Option.cpp

Daniel Dunbar daniel at zuster.org
Tue Mar 24 23:08:47 PDT 2009


Author: ddunbar
Date: Wed Mar 25 01:08:46 2009
New Revision: 67679

URL: http://llvm.org/viewvc/llvm-project?rev=67679&view=rev
Log:
Driver: Replace Option::ForwardToGCC by Option::DriverOption (which
matches the flag in Options.def).

Modified:
    cfe/trunk/include/clang/Driver/Option.h
    cfe/trunk/lib/Driver/OptTable.cpp
    cfe/trunk/lib/Driver/Option.cpp

Modified: cfe/trunk/include/clang/Driver/Option.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Option.h?rev=67679&r1=67678&r2=67679&view=diff

==============================================================================
--- cfe/trunk/include/clang/Driver/Option.h (original)
+++ cfe/trunk/include/clang/Driver/Option.h Wed Mar 25 01:08:46 2009
@@ -82,8 +82,8 @@
     /// Always render this option joined with its value.
     bool ForceJoinedRender : 1;    
 
-    /// Forward to generic GCC tools.
-    bool ForwardToGCC : 1;    
+    /// This option is only for consumed by the driver.
+    bool DriverOption : 1;    
 
   protected:
     Option(OptionClass Kind, options::ID ID, const char *Name, 
@@ -112,8 +112,10 @@
     bool hasForceJoinedRender() const { return ForceJoinedRender; }
     void setForceJoinedRender(bool Value) { ForceJoinedRender = Value; }
     
-    bool hasForwardToGCC() const { return ForwardToGCC; }
-    void setForwardToGCC(bool Value) { ForwardToGCC = Value; }
+    bool isDriverOption() const { return DriverOption; }
+    void setDriverOption(bool Value) { DriverOption = Value; }
+
+    bool hasForwardToGCC() const { return !DriverOption && !LinkerInput; }
 
     /// getUnaliasedOption - Return the final option this option
     /// aliases (itself, if the option has no alias).

Modified: cfe/trunk/lib/Driver/OptTable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/OptTable.cpp?rev=67679&r1=67678&r2=67679&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/OptTable.cpp (original)
+++ cfe/trunk/lib/Driver/OptTable.cpp Wed Mar 25 01:08:46 2009
@@ -185,18 +185,13 @@
     case 'S': 
       assert(info.Kind == Option::JoinedClass && "Invalid option.");
       Opt->setForceSeparateRender(true); break;
-    case 'd': Opt->setForwardToGCC(false); break;
+    case 'd': Opt->setDriverOption(true); break;
     case 'i': Opt->setNoOptAsInput(true); break;
     case 'l': Opt->setLinkerInput(true); break;
     case 'u': Opt->setUnsupported(true); break;
     }
   }
 
-  // Linker inputs shouldn't be forwarded to GCC as arguments (they
-  // will, however, be forwarded as inputs).
-  if (Opt->isLinkerInput())
-    Opt->setForwardToGCC(false);
-
   return Opt;
 }
 

Modified: cfe/trunk/lib/Driver/Option.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Option.cpp?rev=67679&r1=67678&r2=67679&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/Option.cpp (original)
+++ cfe/trunk/lib/Driver/Option.cpp Wed Mar 25 01:08:46 2009
@@ -21,7 +21,7 @@
   : Kind(_Kind), ID(_ID), Name(_Name), Group(_Group), Alias(_Alias),
     Unsupported(false), LinkerInput(false), NoOptAsInput(false),
     ForceSeparateRender(false), ForceJoinedRender(false),
-    ForwardToGCC(true)
+    DriverOption(false)
 {
 
   // Multi-level aliases are not supported, and alias options cannot





More information about the cfe-commits mailing list