aboutsummaryrefslogtreecommitdiff
path: root/utils
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
commit739c720e66e1b8889bb752131e4e27b797cec97c (patch)
tree91154f0b71da4104c58ec54dfa93da87c3dae4d0 /utils
parent3321b0ff2408c2a2c5d84f88c5b953f36c99d90a (diff)
Add 'hidden' and 'really_hidden' option properties.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60198 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/LLVMCConfigurationEmitter.cpp44
1 files changed, 43 insertions, 1 deletions
diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp
index da4ed78a24..668282a91a 100644
--- a/utils/TableGen/LLVMCConfigurationEmitter.cpp
+++ b/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 << "\")";