[PATCH] [lld] add InputGraph to process Command line arguments

kledzik at apple.com kledzik at apple.com
Mon Aug 12 15:50:31 PDT 2013


  Can you better explain the need for OptionInfo and OptType?   It looks like instead of having each driver directly process the args using the utilities in llvm::opt::InputArgList, you map each Arg type into an OptType, dispatch on that, and then switch on the arg type again.  In the Darwin case, I don't see any value in that extra step.  In fact, it can interfere with how the driver checks for interactions between options.

  Since each driver knows what do do with each Arg, it implicitly knows if and how to add it to the InputGraph. So, I don't see the value of OptType.


================
Comment at: include/lld/Driver/OptionInfo.h:32-42
@@ +31,13 @@
+  /// linker
+  enum class OptType : uint8_t {
+    Opt_Unknown,           // The option is Unknown
+        Opt_Ignore,        // Ignore this option
+        Opt_LLVMOption,    // The Option is handled by LLVM
+        Opt_Positional,    // Positional Option
+        Opt_SimpleControl, // A simple control flag
+        Opt_ControlEnter,  // Start the control option
+        Opt_ControlExit,   // Exit the control option
+        Opt_Global,        // Global Option
+        Opt_Input          // Input File
+  };
+
----------------
Since OptType is an enum class, you do not need the Opt_ prefix since the enumerator names are not in the global namespace. The Opt_ prefix is also confusingly similar to the tablegen created OPT_ names for argument processing.


http://llvm-reviews.chandlerc.com/D1217



More information about the llvm-commits mailing list