mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-01 01:30:36 +00:00
Add 'hidden' and 'really_hidden' option properties.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60198 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3321b0ff24
commit
739c720e66
@ -38,10 +38,12 @@ def prefix_list_option;
|
|||||||
def append_cmd;
|
def append_cmd;
|
||||||
def forward;
|
def forward;
|
||||||
def forward_as;
|
def forward_as;
|
||||||
|
def help;
|
||||||
|
def hidden;
|
||||||
|
def really_hidden;
|
||||||
|
def required;
|
||||||
def stop_compilation;
|
def stop_compilation;
|
||||||
def unpack_values;
|
def unpack_values;
|
||||||
def help;
|
|
||||||
def required;
|
|
||||||
|
|
||||||
// Empty DAG marker.
|
// Empty DAG marker.
|
||||||
def empty;
|
def empty;
|
||||||
|
@ -353,6 +353,12 @@ currently implemented option types and properties are described below:
|
|||||||
|
|
||||||
- ``required`` - this option is obligatory.
|
- ``required`` - this option is obligatory.
|
||||||
|
|
||||||
|
- ``hidden`` - this option should not appear in the ``--help``
|
||||||
|
output (but should appear in the ``--help-hidden`` output).
|
||||||
|
|
||||||
|
- ``really_hidden`` - the option should not appear in any help
|
||||||
|
output.
|
||||||
|
|
||||||
|
|
||||||
Option list - specifying all options in a single place
|
Option list - specifying all options in a single place
|
||||||
======================================================
|
======================================================
|
||||||
|
@ -198,7 +198,8 @@ struct OptionDescription {
|
|||||||
// Global option description.
|
// Global option description.
|
||||||
|
|
||||||
namespace GlobalOptionDescriptionFlags {
|
namespace GlobalOptionDescriptionFlags {
|
||||||
enum GlobalOptionDescriptionFlags { Required = 0x1 };
|
enum GlobalOptionDescriptionFlags { Required = 0x1, Hidden = 0x2,
|
||||||
|
ReallyHidden = 0x4 };
|
||||||
}
|
}
|
||||||
|
|
||||||
struct GlobalOptionDescription : public OptionDescription {
|
struct GlobalOptionDescription : public OptionDescription {
|
||||||
@ -222,6 +223,20 @@ struct GlobalOptionDescription : public OptionDescription {
|
|||||||
Flags |= GlobalOptionDescriptionFlags::Required;
|
Flags |= GlobalOptionDescriptionFlags::Required;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isHidden() const {
|
||||||
|
return Flags & GlobalOptionDescriptionFlags::Hidden;
|
||||||
|
}
|
||||||
|
void setHidden() {
|
||||||
|
Flags |= GlobalOptionDescriptionFlags::Hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isReallyHidden() const {
|
||||||
|
return Flags & GlobalOptionDescriptionFlags::ReallyHidden;
|
||||||
|
}
|
||||||
|
void setReallyHidden() {
|
||||||
|
Flags |= GlobalOptionDescriptionFlags::ReallyHidden;
|
||||||
|
}
|
||||||
|
|
||||||
/// Merge - Merge two option descriptions.
|
/// Merge - Merge two option descriptions.
|
||||||
void Merge (const GlobalOptionDescription& other)
|
void Merge (const GlobalOptionDescription& other)
|
||||||
{
|
{
|
||||||
@ -412,8 +427,12 @@ public:
|
|||||||
&CollectOptionProperties::onForwardAs;
|
&CollectOptionProperties::onForwardAs;
|
||||||
optionPropertyHandlers_["help"] =
|
optionPropertyHandlers_["help"] =
|
||||||
&CollectOptionProperties::onHelp;
|
&CollectOptionProperties::onHelp;
|
||||||
|
optionPropertyHandlers_["hidden"] =
|
||||||
|
&CollectOptionProperties::onHidden;
|
||||||
optionPropertyHandlers_["output_suffix"] =
|
optionPropertyHandlers_["output_suffix"] =
|
||||||
&CollectOptionProperties::onOutputSuffix;
|
&CollectOptionProperties::onOutputSuffix;
|
||||||
|
optionPropertyHandlers_["really_hidden"] =
|
||||||
|
&CollectOptionProperties::onReallyHidden;
|
||||||
optionPropertyHandlers_["required"] =
|
optionPropertyHandlers_["required"] =
|
||||||
&CollectOptionProperties::onRequired;
|
&CollectOptionProperties::onRequired;
|
||||||
optionPropertyHandlers_["stop_compilation"] =
|
optionPropertyHandlers_["stop_compilation"] =
|
||||||
@ -493,6 +512,18 @@ private:
|
|||||||
optDesc_.Help = help_message;
|
optDesc_.Help = help_message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onHidden (const DagInit* d) {
|
||||||
|
checkNumberOfArguments(d, 0);
|
||||||
|
checkToolProps(d);
|
||||||
|
optDesc_.setHidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
void onReallyHidden (const DagInit* d) {
|
||||||
|
checkNumberOfArguments(d, 0);
|
||||||
|
checkToolProps(d);
|
||||||
|
optDesc_.setReallyHidden();
|
||||||
|
}
|
||||||
|
|
||||||
void onRequired (const DagInit* d) {
|
void onRequired (const DagInit* d) {
|
||||||
checkNumberOfArguments(d, 0);
|
checkNumberOfArguments(d, 0);
|
||||||
checkToolProps(d);
|
checkToolProps(d);
|
||||||
@ -1413,6 +1444,17 @@ void EmitOptionDescriptions (const GlobalOptionDescriptions& descs,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (val.isReallyHidden() || val.isHidden()) {
|
||||||
|
if (val.isRequired())
|
||||||
|
O << " |";
|
||||||
|
else
|
||||||
|
O << ",";
|
||||||
|
if (val.isReallyHidden())
|
||||||
|
O << " cl::ReallyHidden";
|
||||||
|
else
|
||||||
|
O << " cl::Hidden";
|
||||||
|
}
|
||||||
|
|
||||||
if (!val.Help.empty())
|
if (!val.Help.empty())
|
||||||
O << ", cl::desc(\"" << val.Help << "\")";
|
O << ", cl::desc(\"" << val.Help << "\")";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user