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

Shankar Kalpathi Easwaran shankarke at gmail.com
Mon Aug 12 21:32:54 PDT 2013


  OptionInfo could serve these purposes

  a) Separate the common options that are shared by MachO, Link and GnuLD. The base class for OptionInfo could implement all the functionalities supported by all the flavors(Currently the common options are duplicated across all the flavors). This could act as a class
  for cleaning up when the td file supports similiar functionality.
  b) Associate options to their types, which achieves seperating how the options are processed by the linker, making the Driver flexible.
  c) Enhances the debugging experience of option handling, If we would record the type of option as part of the InputElement.

  I think validation should be done by the validate routines as part of TargetInfo as well as the validation routine that are part of each InputElement.

  OptionInfo should just handle how the options are individually dealt in my opinion and validation completely seperated when options are handled.


================
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
+  };
+
----------------
kledzik at apple.com wrote:
> 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.
Agree, will remove the Opt prefix.


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



More information about the llvm-commits mailing list