@@ -53,66 +53,87 @@ namespace {
53
53
54
54
namespace options {
55
55
56
+ static llvm::cl::OptionCategory Category (" swift-api-digester Options" );
57
+
56
58
static llvm::cl::opt<bool >
57
- IncludeAllModules (" include-all" , llvm::cl::desc(" Include all modules from the SDK" ));
59
+ IncludeAllModules (" include-all" ,
60
+ llvm::cl::desc (" Include all modules from the SDK" ),
61
+ llvm::cl::cat(Category));
58
62
59
63
static llvm::cl::list<std::string>
60
- ModuleNames (" module" , llvm::cl::ZeroOrMore, llvm::cl::desc(" Names of modules" ));
64
+ ModuleNames (" module" , llvm::cl::ZeroOrMore, llvm::cl::desc(" Names of modules" ),
65
+ llvm::cl::cat(Category));
61
66
62
67
static llvm::cl::opt<std::string>
63
68
ModuleList (" module-list-file" ,
64
- llvm::cl::desc (" File containing a new-line separated list of modules" ));
69
+ llvm::cl::desc (" File containing a new-line separated list of modules" ),
70
+ llvm::cl::cat(Category));
65
71
66
72
static llvm::cl::opt<std::string>
67
73
ProtReqWhiteList (" protocol-requirement-white-list" ,
68
- llvm::cl::desc (" File containing a new-line separated list of protocol names" ));
74
+ llvm::cl::desc (" File containing a new-line separated list of protocol names" ),
75
+ llvm::cl::cat(Category));
69
76
70
77
static llvm::cl::opt<std::string>
71
- OutputFile (" o" , llvm::cl::desc(" Output file" ));
78
+ OutputFile (" o" , llvm::cl::desc(" Output file" ),
79
+ llvm::cl::cat(Category));
72
80
73
81
static llvm::cl::opt<std::string>
74
- SDK (" sdk" , llvm::cl::desc(" path to the SDK to build against" ));
82
+ SDK (" sdk" , llvm::cl::desc(" path to the SDK to build against" ),
83
+ llvm::cl::cat(Category));
75
84
76
85
static llvm::cl::opt<std::string>
77
- Triple (" target" , llvm::cl::desc(" target triple" ));
86
+ Triple (" target" , llvm::cl::desc(" target triple" ),
87
+ llvm::cl::cat(Category));
78
88
79
89
static llvm::cl::opt<std::string>
80
- ModuleCachePath (" module-cache-path" , llvm::cl::desc(" Clang module cache path" ));
90
+ ModuleCachePath (" module-cache-path" , llvm::cl::desc(" Clang module cache path" ),
91
+ llvm::cl::cat(Category));
81
92
82
93
static llvm::cl::opt<std::string>
83
94
ResourceDir (" resource-dir" ,
84
- llvm::cl::desc (" The directory that holds the compiler resource files" ));
95
+ llvm::cl::desc (" The directory that holds the compiler resource files" ),
96
+ llvm::cl::cat(Category));
85
97
86
98
static llvm::cl::list<std::string>
87
- FrameworkPaths (" F" , llvm::cl::desc(" add a directory to the framework search path" ));
99
+ FrameworkPaths (" F" , llvm::cl::desc(" add a directory to the framework search path" ),
100
+ llvm::cl::cat(Category));
88
101
89
102
static llvm::cl::list<std::string>
90
- ModuleInputPaths (" I" , llvm::cl::desc(" add a module for input" ));
103
+ ModuleInputPaths (" I" , llvm::cl::desc(" add a module for input" ),
104
+ llvm::cl::cat(Category));
91
105
92
106
static llvm::cl::list<std::string>
93
107
CCSystemFrameworkPaths (" iframework" ,
94
- llvm::cl::desc (" add a directory to the clang importer system framework search path" ));
108
+ llvm::cl::desc (" add a directory to the clang importer system framework search path" ),
109
+ llvm::cl::cat(Category));
95
110
96
111
static llvm::cl::opt<bool >
97
112
AbortOnModuleLoadFailure (" abort-on-module-fail" ,
98
- llvm::cl::desc (" Abort if a module failed to load" ));
113
+ llvm::cl::desc (" Abort if a module failed to load" ),
114
+ llvm::cl::cat(Category));
99
115
100
116
static llvm::cl::opt<bool >
101
- Verbose (" v" , llvm::cl::desc(" Verbose" ));
117
+ Verbose (" v" , llvm::cl::desc(" Verbose" ),
118
+ llvm::cl::cat(Category));
102
119
103
120
static llvm::cl::opt<bool >
104
- Abi (" abi" , llvm::cl::desc(" Dumping ABI interface" ), llvm::cl::init(false ));
121
+ Abi (" abi" , llvm::cl::desc(" Dumping ABI interface" ), llvm::cl::init(false ),
122
+ llvm::cl::cat(Category));
105
123
106
124
static llvm::cl::opt<bool >
107
125
SwiftOnly (" swift-only" ,
108
126
llvm::cl::desc (" Only include APIs defined from Swift source" ),
109
- llvm::cl::init(false ));
127
+ llvm::cl::init(false ),
128
+ llvm::cl::cat(Category));
110
129
111
130
static llvm::cl::opt<bool >
112
- PrintModule (" print-module" , llvm::cl::desc(" Print module names in diagnostics" ));
131
+ PrintModule (" print-module" , llvm::cl::desc(" Print module names in diagnostics" ),
132
+ llvm::cl::cat(Category));
113
133
114
134
static llvm::cl::opt<ActionType>
115
135
Action (llvm::cl::desc(" Mode:" ), llvm::cl::init(ActionType::None),
136
+ llvm::cl::cat(Category),
116
137
llvm::cl::values(
117
138
clEnumValN (ActionType::DumpSDK,
118
139
" dump-sdk" ,
@@ -141,32 +162,39 @@ Action(llvm::cl::desc("Mode:"), llvm::cl::init(ActionType::None),
141
162
142
163
static llvm::cl::list<std::string>
143
164
SDKJsonPaths (" input-paths" ,
144
- llvm::cl::desc (" The SDK contents under comparison" ));
165
+ llvm::cl::desc (" The SDK contents under comparison" ),
166
+ llvm::cl::cat(Category));
145
167
146
168
static llvm::cl::list<std::string>
147
169
ApisPrintUsrs (" api-usrs" ,
148
170
llvm::cl::desc (" The name of APIs to print their usrs, "
149
- " e.g. Type::Function" ));
171
+ " e.g. Type::Function" ),
172
+ llvm::cl::cat(Category));
150
173
151
174
static llvm::cl::opt<std::string>
152
175
IgnoreRemovedDeclUSRs (" ignored-usrs" ,
153
176
llvm::cl::desc (" the file containing USRs of removed decls "
154
- " that the digester should ignore" ));
177
+ " that the digester should ignore" ),
178
+ llvm::cl::cat(Category));
155
179
156
180
static llvm::cl::opt<std::string>
157
181
SwiftVersion (" swift-version" ,
158
- llvm::cl::desc (" The Swift compiler version to invoke" ));
182
+ llvm::cl::desc (" The Swift compiler version to invoke" ),
183
+ llvm::cl::cat(Category));
159
184
160
185
static llvm::cl::opt<bool >
161
- OutputInJson (" json" , llvm::cl::desc(" Print output in JSON format." ));
186
+ OutputInJson (" json" , llvm::cl::desc(" Print output in JSON format." ),
187
+ llvm::cl::cat(Category));
162
188
163
189
static llvm::cl::opt<bool >
164
190
AvoidLocation (" avoid-location" ,
165
- llvm::cl::desc (" Avoid serializing the file paths of SDK nodes." ));
191
+ llvm::cl::desc (" Avoid serializing the file paths of SDK nodes." ),
192
+ llvm::cl::cat(Category));
166
193
167
194
static llvm::cl::opt<std::string>
168
195
LocationFilter (" location" ,
169
- llvm::cl::desc (" Filter nodes with the given location." ));
196
+ llvm::cl::desc (" Filter nodes with the given location." ),
197
+ llvm::cl::cat(Category));
170
198
} // namespace options
171
199
172
200
namespace {
@@ -2336,6 +2364,7 @@ int main(int argc, char *argv[]) {
2336
2364
PROGRAM_START (argc, argv);
2337
2365
INITIALIZE_LLVM ();
2338
2366
2367
+ llvm::cl::HideUnrelatedOptions (options::Category);
2339
2368
llvm::cl::ParseCommandLineOptions (argc, argv, " Swift SDK Digester\n " );
2340
2369
CompilerInvocation InitInvok;
2341
2370
0 commit comments