summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2008-11-28 00:13:25 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2008-11-28 00:13:25 +0000
commit3bb3da6f4c88a838492d3fae074353e5cd0acb6a (patch)
tree6ddb30be9b0960b1229235536fecd4e5f37535e0
parent4ad34cbdc042030f403328001b8f9286b2e8c766 (diff)
downloadbcm5719-llvm-3bb3da6f4c88a838492d3fae074353e5cd0acb6a.tar.gz
bcm5719-llvm-3bb3da6f4c88a838492d3fae074353e5cd0acb6a.zip
Add 'hidden' and 'really_hidden' option properties.
llvm-svn: 60198
-rw-r--r--llvm/include/llvm/CompilerDriver/Common.td6
-rw-r--r--llvm/tools/llvmc/doc/LLVMC-Reference.rst6
-rw-r--r--llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp44
3 files changed, 53 insertions, 3 deletions
diff --git a/llvm/include/llvm/CompilerDriver/Common.td b/llvm/include/llvm/CompilerDriver/Common.td
index 4589f9179c3..109a7e5eda1 100644
--- a/llvm/include/llvm/CompilerDriver/Common.td
+++ b/llvm/include/llvm/CompilerDriver/Common.td
@@ -38,10 +38,12 @@ def prefix_list_option;
def append_cmd;
def forward;
def forward_as;
-def stop_compilation;
-def unpack_values;
def help;
+def hidden;
+def really_hidden;
def required;
+def stop_compilation;
+def unpack_values;
// Empty DAG marker.
def empty;
diff --git a/llvm/tools/llvmc/doc/LLVMC-Reference.rst b/llvm/tools/llvmc/doc/LLVMC-Reference.rst
index 290778468a0..919025527b5 100644
--- a/llvm/tools/llvmc/doc/LLVMC-Reference.rst
+++ b/llvm/tools/llvmc/doc/LLVMC-Reference.rst
@@ -353,6 +353,12 @@ currently implemented option types and properties are described below:
- ``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
======================================================
diff --git a/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp b/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
index da4ed78a24c..668282a91a9 100644
--- a/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
+++ b/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
@@ -198,7 +198,8 @@ struct OptionDescription {
// Global option description.
namespace GlobalOptionDescriptionFlags {
- enum GlobalOptionDescriptionFlags { Required = 0x1 };
+ enum GlobalOptionDescriptionFlags { Required = 0x1, Hidden = 0x2,
+ ReallyHidden = 0x4 };
}
struct GlobalOptionDescription : public OptionDescription {
@@ -222,6 +223,20 @@ struct GlobalOptionDescription : public OptionDescription {
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.
void Merge (const GlobalOptionDescription& other)
{
@@ -412,8 +427,12 @@ public:
&CollectOptionProperties::onForwardAs;
optionPropertyHandlers_["help"] =
&CollectOptionProperties::onHelp;
+ optionPropertyHandlers_["hidden"] =
+ &CollectOptionProperties::onHidden;
optionPropertyHandlers_["output_suffix"] =
&CollectOptionProperties::onOutputSuffix;
+ optionPropertyHandlers_["really_hidden"] =
+ &CollectOptionProperties::onReallyHidden;
optionPropertyHandlers_["required"] =
&CollectOptionProperties::onRequired;
optionPropertyHandlers_["stop_compilation"] =
@@ -493,6 +512,18 @@ private:
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) {
checkNumberOfArguments(d, 0);
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())
O << ", cl::desc(\"" << val.Help << "\")";
OpenPOWER on IntegriCloud