diff options
Diffstat (limited to 'include/clang/Driver/Option.h')
-rw-r--r-- | include/clang/Driver/Option.h | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/include/clang/Driver/Option.h b/include/clang/Driver/Option.h index 08b94b1..0864382 100644 --- a/include/clang/Driver/Option.h +++ b/include/clang/Driver/Option.h @@ -21,7 +21,7 @@ using llvm::dyn_cast_or_null; namespace clang { namespace driver { class Arg; - class InputArgList; + class ArgList; class OptionGroup; /// Option - Abstract representation for a single form of driver @@ -50,6 +50,13 @@ namespace driver { JoinedAndSeparateClass }; + enum RenderStyleKind { + RenderCommaJoinedStyle, + RenderJoinedStyle, + RenderSeparateStyle, + RenderValuesStyle + }; + private: OptionClass Kind; @@ -65,7 +72,7 @@ namespace driver { /// Option that this is an alias for, if any. const Option *Alias; - /// Unsupported options will not be rejected. + /// Unsupported options will be rejected. bool Unsupported : 1; /// Treat this option like a linker input? @@ -76,11 +83,8 @@ namespace driver { // FIXME: We should ditch the render/renderAsInput distinction. bool NoOptAsInput : 1; - /// Always render this option as separate form its value. - bool ForceSeparateRender : 1; - - /// Always render this option joined with its value. - bool ForceJoinedRender : 1; + /// The style to using when rendering arguments parsed by this option. + unsigned RenderStyle : 2; /// This option is only consumed by the driver. bool DriverOption : 1; @@ -109,11 +113,10 @@ namespace driver { bool hasNoOptAsInput() const { return NoOptAsInput; } void setNoOptAsInput(bool Value) { NoOptAsInput = Value; } - bool hasForceSeparateRender() const { return ForceSeparateRender; } - void setForceSeparateRender(bool Value) { ForceSeparateRender = Value; } - - bool hasForceJoinedRender() const { return ForceJoinedRender; } - void setForceJoinedRender(bool Value) { ForceJoinedRender = Value; } + RenderStyleKind getRenderStyle() const { + return RenderStyleKind(RenderStyle); + } + void setRenderStyle(RenderStyleKind Value) { RenderStyle = Value; } bool isDriverOption() const { return DriverOption; } void setDriverOption(bool Value) { DriverOption = Value; } @@ -151,7 +154,7 @@ namespace driver { /// If the option accepts the current argument, accept() sets /// Index to the position where argument parsing should resume /// (even if the argument is missing values). - virtual Arg *accept(const InputArgList &Args, unsigned &Index) const = 0; + virtual Arg *accept(const ArgList &Args, unsigned &Index) const = 0; void dump() const; @@ -164,7 +167,7 @@ namespace driver { public: OptionGroup(OptSpecifier ID, const char *Name, const OptionGroup *Group); - virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; + virtual Arg *accept(const ArgList &Args, unsigned &Index) const; static bool classof(const Option *O) { return O->getKind() == Option::GroupClass; @@ -179,7 +182,7 @@ namespace driver { public: InputOption(OptSpecifier ID); - virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; + virtual Arg *accept(const ArgList &Args, unsigned &Index) const; static bool classof(const Option *O) { return O->getKind() == Option::InputClass; @@ -192,7 +195,7 @@ namespace driver { public: UnknownOption(OptSpecifier ID); - virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; + virtual Arg *accept(const ArgList &Args, unsigned &Index) const; static bool classof(const Option *O) { return O->getKind() == Option::UnknownClass; @@ -207,7 +210,7 @@ namespace driver { FlagOption(OptSpecifier ID, const char *Name, const OptionGroup *Group, const Option *Alias); - virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; + virtual Arg *accept(const ArgList &Args, unsigned &Index) const; static bool classof(const Option *O) { return O->getKind() == Option::FlagClass; @@ -220,7 +223,7 @@ namespace driver { JoinedOption(OptSpecifier ID, const char *Name, const OptionGroup *Group, const Option *Alias); - virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; + virtual Arg *accept(const ArgList &Args, unsigned &Index) const; static bool classof(const Option *O) { return O->getKind() == Option::JoinedClass; @@ -233,7 +236,7 @@ namespace driver { SeparateOption(OptSpecifier ID, const char *Name, const OptionGroup *Group, const Option *Alias); - virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; + virtual Arg *accept(const ArgList &Args, unsigned &Index) const; static bool classof(const Option *O) { return O->getKind() == Option::SeparateClass; @@ -246,7 +249,7 @@ namespace driver { CommaJoinedOption(OptSpecifier ID, const char *Name, const OptionGroup *Group, const Option *Alias); - virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; + virtual Arg *accept(const ArgList &Args, unsigned &Index) const; static bool classof(const Option *O) { return O->getKind() == Option::CommaJoinedClass; @@ -267,7 +270,7 @@ namespace driver { unsigned getNumArgs() const { return NumArgs; } - virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; + virtual Arg *accept(const ArgList &Args, unsigned &Index) const; static bool classof(const Option *O) { return O->getKind() == Option::MultiArgClass; @@ -282,7 +285,7 @@ namespace driver { JoinedOrSeparateOption(OptSpecifier ID, const char *Name, const OptionGroup *Group, const Option *Alias); - virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; + virtual Arg *accept(const ArgList &Args, unsigned &Index) const; static bool classof(const Option *O) { return O->getKind() == Option::JoinedOrSeparateClass; @@ -297,7 +300,7 @@ namespace driver { JoinedAndSeparateOption(OptSpecifier ID, const char *Name, const OptionGroup *Group, const Option *Alias); - virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; + virtual Arg *accept(const ArgList &Args, unsigned &Index) const; static bool classof(const Option *O) { return O->getKind() == Option::JoinedAndSeparateClass; |