clang API Documentation
#include <Option.h>

Option - Abstract representation for a single form of driver argument.
An Option class represents a form of option that the driver takes, for example how many arguments the option has and how they can be provided. Individual option instances store additional information about what group the option is a member of (if any), if the option is an alias, and a number of flags. At runtime the driver parses the command line into concrete Arg instances, each of which corresponds to a particular Option instance.
| Option::Option | ( | OptionClass | Kind, |
| OptSpecifier | ID, | ||
| const char * | Name, | ||
| const OptionGroup * | Group, | ||
| const Option * | Alias | ||
| ) | [protected] |
Definition at line 20 of file Option.cpp.
References CommaJoinedClass, FlagClass, GroupClass, InputClass, JoinedAndSeparateClass, JoinedClass, JoinedOrSeparateClass, MultiArgClass, RenderCommaJoinedStyle, RenderJoinedStyle, RenderSeparateStyle, RenderValuesStyle, SeparateClass, and UnknownClass.
| Option::~Option | ( | ) | [virtual] |
Definition at line 58 of file Option.cpp.
| virtual Arg* clang::driver::Option::accept | ( | const ArgList & | Args, |
| unsigned & | Index | ||
| ) | const [pure virtual] |
accept - Potentially accept the current argument, returning a new Arg instance, or 0 if the option does not accept this argument (or the argument is missing values).
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).
Implemented in clang::driver::JoinedAndSeparateOption, clang::driver::JoinedOrSeparateOption, clang::driver::MultiArgOption, clang::driver::CommaJoinedOption, clang::driver::SeparateOption, clang::driver::JoinedOption, clang::driver::FlagOption, clang::driver::UnknownOption, clang::driver::InputOption, and clang::driver::OptionGroup.
| static bool clang::driver::Option::classof | ( | const Option * | ) | [inline, static] |
Reimplemented in clang::driver::JoinedAndSeparateOption, clang::driver::JoinedOrSeparateOption, clang::driver::MultiArgOption, clang::driver::CommaJoinedOption, clang::driver::SeparateOption, clang::driver::JoinedOption, clang::driver::FlagOption, clang::driver::UnknownOption, clang::driver::InputOption, and clang::driver::OptionGroup.
| void Option::dump | ( | ) | const |
Definition at line 61 of file Option.cpp.
References CommaJoinedClass, dump(), FlagClass, GroupClass, InputClass, JoinedAndSeparateClass, JoinedClass, JoinedOrSeparateClass, MultiArgClass, P, SeparateClass, and UnknownClass.
Referenced by clang::driver::Arg::dump(), dump(), and clang::driver::OptTable::OptTable().
| const Option* clang::driver::Option::getAlias | ( | ) | const [inline] |
| const OptionGroup* clang::driver::Option::getGroup | ( | ) | const [inline] |
| unsigned clang::driver::Option::getID | ( | ) | const [inline] |
Definition at line 100 of file Option.h.
References clang::driver::OptSpecifier::getID().
Referenced by clang::driver::tools::Clang::ConstructJob(), ParseAnalyzerArgs(), and clang::driver::toolchains::Darwin::TranslateArgs().
| OptionClass clang::driver::Option::getKind | ( | ) | const [inline] |
Definition at line 101 of file Option.h.
Referenced by clang::driver::OptionGroup::classof(), clang::driver::InputOption::classof(), clang::driver::UnknownOption::classof(), clang::driver::FlagOption::classof(), clang::driver::JoinedOption::classof(), clang::driver::SeparateOption::classof(), clang::driver::CommaJoinedOption::classof(), clang::driver::MultiArgOption::classof(), clang::driver::JoinedOrSeparateOption::classof(), and clang::driver::JoinedAndSeparateOption::classof().
| StringRef clang::driver::Option::getName | ( | ) | const [inline] |
Definition at line 102 of file Option.h.
Referenced by clang::driver::FlagOption::accept(), clang::driver::JoinedOption::accept(), clang::driver::SeparateOption::accept(), clang::driver::CommaJoinedOption::accept(), clang::driver::MultiArgOption::accept(), clang::driver::JoinedOrSeparateOption::accept(), clang::driver::JoinedAndSeparateOption::accept(), clang::driver::Driver::BuildActions(), clang::driver::tools::Clang::ConstructJob(), getRenderName(), clang::driver::DerivedArgList::MakeFlagArg(), clang::driver::DerivedArgList::MakeJoinedArg(), clang::driver::DerivedArgList::MakeSeparateArg(), clang::driver::Driver::PrintOptions(), and clang::driver::Arg::render().
| StringRef clang::driver::Option::getRenderName | ( | ) | const [inline] |
getRenderName - Return the name to use when rendering this option.
Definition at line 142 of file Option.h.
References getName(), and getUnaliasedOption().
| RenderStyleKind clang::driver::Option::getRenderStyle | ( | ) | const [inline] |
| const Option* clang::driver::Option::getUnaliasedOption | ( | ) | const [inline] |
getUnaliasedOption - Return the final option this option aliases (itself, if the option has no alias).
Definition at line 135 of file Option.h.
References getUnaliasedOption().
Referenced by clang::driver::FlagOption::accept(), clang::driver::JoinedOption::accept(), clang::driver::SeparateOption::accept(), clang::driver::CommaJoinedOption::accept(), clang::driver::MultiArgOption::accept(), clang::driver::JoinedOrSeparateOption::accept(), clang::driver::JoinedAndSeparateOption::accept(), getRenderName(), and getUnaliasedOption().
| bool clang::driver::Option::hasForwardToGCC | ( | ) | const [inline] |
Definition at line 129 of file Option.h.
Referenced by clang::driver::tools::gcc::Common::ConstructJob(), and clang::driver::tools::hexagon::Link::ConstructJob().
| bool clang::driver::Option::hasNoArgumentUnused | ( | ) | const [inline] |
Definition at line 123 of file Option.h.
Referenced by clang::driver::Driver::BuildJobs().
| bool clang::driver::Option::hasNoForward | ( | ) | const [inline] |
| bool clang::driver::Option::hasNoOptAsInput | ( | ) | const [inline] |
| bool clang::driver::Option::isDriverOption | ( | ) | const [inline] |
Definition at line 120 of file Option.h.
Referenced by clang::driver::toolchains::Darwin::TranslateArgs().
| bool clang::driver::Option::isLinkerInput | ( | ) | const [inline] |
Definition at line 109 of file Option.h.
Referenced by clang::driver::Driver::BuildInputs(), and clang::driver::toolchains::Darwin::TranslateArgs().
| bool clang::driver::Option::isUnsupported | ( | ) | const [inline] |
Definition at line 106 of file Option.h.
Referenced by clang::driver::Driver::ParseArgStrings().
| bool Option::matches | ( | OptSpecifier | ID | ) | const |
matches - Predicate for whether this option is part of the given option (which may be a group).
Note that matches against options which are an alias should never be done -- aliases do not participate in matching and so such a query will always be false.
Definition at line 96 of file Option.cpp.
References matches().
Referenced by addExceptionArgs(), AddLinkerInputs(), clang::driver::Driver::BuildInputs(), clang::driver::Driver::BuildJobsForAction(), clang::driver::Driver::BuildUniversalActions(), computeTargetTriple(), clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::ClangAs::ConstructJob(), clang::driver::tools::gcc::Common::ConstructJob(), clang::driver::tools::hexagon::Link::ConstructJob(), clang::driver::Driver::generateCompilationDiagnostics(), clang::driver::Driver::IsUsingLTO(), matches(), ParseHeaderSearchArgs(), ParsePreprocessorArgs(), shouldUseFramePointer(), clang::driver::toolchains::Darwin::TranslateArgs(), and UseRelaxAll().
| void clang::driver::Option::setDriverOption | ( | bool | Value | ) | [inline] |
| void clang::driver::Option::setLinkerInput | ( | bool | Value | ) | [inline] |
| void clang::driver::Option::setNoArgumentUnused | ( | bool | Value | ) | [inline] |
| void clang::driver::Option::setNoForward | ( | bool | Value | ) | [inline] |
| void clang::driver::Option::setNoOptAsInput | ( | bool | Value | ) | [inline] |
| void clang::driver::Option::setRenderStyle | ( | RenderStyleKind | Value | ) | [inline] |
| void clang::driver::Option::setUnsupported | ( | bool | Value | ) | [inline] |