30 // Attributes that are classified as standard options.
31 auto StandardAttributes = [&]() {
32 // Set the 'standard' attribute to indicate its associated attributes.
33 setAttributeStandard();
36 setAttributeCoverage();
37 setAttributeDirectories();
38 setAttributeDiscriminator();
39 setAttributeFilename();
42 setAttributeLanguage();
44 setAttributeProducer();
45 setAttributePublics();
47 setAttributeReference();
51 // Attributes that are classified as extended options.
52 auto ExtendedAttributes = [&]() {
53 // Set the 'extended' attribute to indicate its associated attributes.
54 setAttributeExtended();
56 setAttributeArgument();
57 setAttributeDiscarded();
58 setAttributeEncoded();
60 setAttributeGenerated();
62 setAttributeInserted();
63 setAttributeLinkage();
65 setAttributeLocation();
67 setAttributePathname();
68 setAttributeQualified();
69 setAttributeQualifier();
70 setAttributeRegister();
72 setAttributeSubrange();
74 setAttributeTypename();
77 // '--Attribute=standard' settings.
78 if (getAttributeStandard())
81 // '--Attribute=extended' settings.
82 if (getAttributeExtended())
85 // '--Attribute=all' settings.
86 if (getAttributeAll()) {
91 // '--attribute=pathname' supersedes '--attribute=filename'.
92 if (getAttributePathname())
93 resetAttributeFilename();
95 // Assume '--output=text' as default
96 if (!getOutputText() && !getOutputJson())
99 // '--output=all' settings.
100 if (getOutputAll()) {
106 // A view split folder was specified.
107 if (getOutputFolder().length())
110 // Always use the full pathname with splitted output.
111 if (getOutputSplit())
112 setAttributePathname();
114 // '--print=elements' settings.
115 if (getPrintElements()) {
116 setPrintInstructions();
123 // '--print=all' settings.
125 setPrintInstructions();
135 // '--warning=all' settings.
136 if (getWarningAll()) {
137 setWarningCoverages();
139 setWarningLocations();
143 // '--internal=all' settings.
144 if (getInternalAll()) {
145 setInternalCmdline();
147 setInternalIntegrity();
152 // '--compare=all' settings.
153 if (getCompareAll()) {
160 // Compare the scopes if a request for compare symbols, types, lines.
161 if (getCompareLines() || getCompareSymbols() || getCompareTypes())
164 // Generic request for comparison.
165 if (getCompareScopes())
168 // Print any logical line (debug or instruction).
169 if (getPrintInstructions() || getPrintLines())
172 // Print any logical element (line, scope, symbol or type).
173 if (getPrintAnyLine() || getPrintScopes() || getPrintSymbols() ||
175 setPrintAnyElement();
177 // Print 'sizes' or 'summary'.
178 if (getPrintSizes() && getPrintSummary())
179 setPrintSizesSummary();
181 // Generic request for printing.
182 if (getPrintAll() || getPrintAnyElement() || getPrintSizesSummary() ||
186 // '--reports=all' settings.
187 if (getReportAll()) {
194 // '--report=view' is a shortcut for '--report=parents,children'.
195 if (getReportView()) {
200 // The report will include: Parents or Children.
201 if (getReportParents() || getReportChildren() || getReportView())
204 // The report will include: List or Parents or Children.
205 if (getReportList() || getReportAnyView())
208 // If a view or element comparison has been requested, the following options
209 // must be set, in order to get a correct compare:
210 // 1) Sort the CUs, to get a fast compare.
211 // 2) Encode template instantiations, so the names include template
212 // parameter information.
213 // 3) Include qualified types and their sizes.
214 // 4) Include any inserted abstract references.
215 // 5) For added/missing elements add the '+' or '-' tags.
216 if (getCompareExecute()) {
221 setAttributeArgument();
222 setAttributeEncoded();
223 setAttributeInserted();
224 setAttributeMissing();
225 setAttributeQualified();
229 // Enable formatting for printing (indentation, print children).
230 setPrintFormatting();
232 // These attributes are dependent on the capture of location information.
233 if (getAttributeCoverage() || getAttributeGaps() || getAttributeRegister())
234 setAttributeLocation();
236 // Location information is only relevant when printing symbols.
237 if (!getPrintSymbols()) {
238 resetAttributeCoverage();
239 resetAttributeGaps();
240 resetAttributeLocation();
241 resetAttributeRegister();
244 // Quick check for printing any element source information.
245 if (getAttributeFilename() || getAttributePathname())
246 setAttributeAnySource();
248 // Quick check for printing any location information.
249 if (getAttributeLocation() || getAttributeRange())
250 setAttributeAnyLocation();
252 if (getAttributeRange() || getPrintAnyLine())
253 setGeneralCollectRanges();
255 calculateIndentationSize();
257 // Print collected command line options.
286 OS <<
"** Attributes **\n"
287 <<
"All: " << getAttributeAll() <<
", "
288 <<
"Argument: " << getAttributeArgument() <<
", "
289 <<
"Base: " << getAttributeBase() <<
", "
290 <<
"Coverage: " << getAttributeCoverage() <<
"\n"
291 <<
"Directories: " << getAttributeDirectories() <<
", "
292 <<
"Discarded: " << getAttributeDiscarded() <<
", "
293 <<
"Discriminator: " << getAttributeDiscriminator() <<
", "
294 <<
"Encoded: " << getAttributeEncoded() <<
"\n"
295 <<
"Extended: " << getAttributeExtended() <<
", "
296 <<
"Filename: " << getAttributeFilename() <<
", "
297 <<
"Files: " << getAttributeFiles() <<
", "
298 <<
"Format: " << getAttributeFormat() <<
"\n"
299 <<
"Gaps: " << getAttributeGaps() <<
", "
300 <<
"Generated: " << getAttributeGenerated() <<
", "
301 <<
"Global: " << getAttributeGlobal() <<
", "
302 <<
"Inserted: " << getAttributeInserted() <<
"\n"
303 <<
"Level: " << getAttributeLevel() <<
", "
304 <<
"Linkage: " << getAttributeLinkage() <<
", "
305 <<
"Local: " << getAttributeLocal() <<
", "
306 <<
"Location: " << getAttributeLocation() <<
"\n"
307 <<
"Offset: " << getAttributeOffset() <<
", "
308 <<
"Pathname: " << getAttributePathname() <<
", "
309 <<
"Producer: " << getAttributeProducer() <<
", "
310 <<
"Publics: " << getAttributePublics() <<
"\n"
311 <<
"Qualified: " << getAttributeQualified() <<
", "
312 <<
"Qualifier: " << getAttributeQualifier() <<
", "
313 <<
"Range: " << getAttributeRange() <<
", "
314 <<
"Reference: " << getAttributeReference() <<
"\n"
315 <<
"Register: " << getAttributeRegister() <<
", "
316 <<
"Size: " << getAttributeSize() <<
", "
317 <<
"Standard: " << getAttributeStandard() <<
", "
318 <<
"Subrange: " << getAttributeSubrange() <<
"\n"
319 <<
"System: " << getAttributeSystem() <<
", "
320 <<
"Typename: " << getAttributeTypename() <<
", "
321 <<
"Underlying: " << getAttributeUnderlying() <<
", "
322 <<
"Zero: " << getAttributeZero() <<
"\n";
323 OS <<
"Added: " << getAttributeAdded() <<
", "
324 <<
"AnyLocation: " << getAttributeAnyLocation() <<
", "
325 <<
"AnySource: " << getAttributeAnySource() <<
", "
326 <<
"Missing: " << getAttributeMissing() <<
"\n"
330 OS <<
"** Compare **\n"
331 <<
"All: " << getCompareAll() <<
", "
332 <<
"Lines: " << getCompareLines() <<
", "
333 <<
"Scopes: " << getCompareScopes() <<
", "
334 <<
"Symbols: " << getCompareSymbols() <<
", "
335 <<
"Types: " << getCompareTypes() <<
"\n";
336 OS <<
"Context: " << getCompareContext() <<
", "
337 <<
"Execute: " << getCompareExecute() <<
", "
338 <<
"Print: " << getComparePrint() <<
"\n"
342 OS <<
"** Print **\n"
343 <<
"All: " << getPrintAll() <<
", "
344 <<
"Elements: " << getPrintElements() <<
", "
345 <<
"Instructions: " << getPrintInstructions() <<
", "
346 <<
"Lines: " << getPrintLines() <<
"\n"
347 <<
"Scopes: " << getPrintScopes() <<
", "
348 <<
"Sizes: " << getPrintSizes() <<
", "
349 <<
"Summary: " << getPrintSummary() <<
", "
350 <<
"Symbols: " << getPrintSymbols() <<
"\n"
351 <<
"Types: " << getPrintTypes() <<
", "
352 <<
"Warnings: " << getPrintWarnings() <<
"\n";
353 OS <<
"AnyElemeny: " << getPrintAnyElement() <<
", "
354 <<
"AnyLine: " << getPrintAnyLine() <<
", "
355 <<
"Execute: " << getPrintExecute() <<
", "
356 <<
"Formatting: " << getPrintFormatting() <<
"\n"
357 <<
"Offset: " << getPrintOffset() <<
", "
358 <<
"SizesSummary: " << getPrintSizesSummary() <<
"\n"
362 OS <<
"** Report **\n"
363 <<
"All: " << getReportAll() <<
", "
364 <<
"Children: " << getReportChildren() <<
", "
365 <<
"List: " << getReportList() <<
", "
366 <<
"Parents: " << getReportParents() <<
", "
367 <<
"View: " << getReportView() <<
"\n";
368 OS <<
"AnyView: " << getReportAnyView() <<
", "
369 <<
"Execute: " << getReportExecute() <<
"\n"
373 OS <<
"** Select **\n"
374 <<
"IgnoreCase: " << getSelectIgnoreCase() <<
", "
375 <<
"UseRegex: " << getSelectUseRegex() <<
", "
376 <<
"Execute: " << getSelectExecute() <<
", "
377 <<
"GenericKind: " << getSelectGenericKind() <<
"\n"
378 <<
"GenericPattern: " << getSelectGenericPattern() <<
", "
379 <<
"OffsetPattern: " << getSelectOffsetPattern() <<
"\n"
383 OS <<
"** Warning **\n"
384 <<
"All: " << getWarningAll() <<
", "
385 <<
"Coverage: " << getWarningCoverages() <<
", "
386 <<
"Lines: " << getWarningLines() <<
", "
387 <<
"Locations: " << getWarningLocations() <<
", "
388 <<
"Ranges: " << getWarningRanges() <<
"\n"
392 OS <<
"** Internal **\n"
393 <<
"All: " <<
Options.getInternalAll() <<
", "
394 <<
"Cmdline: " <<
Options.getInternalCmdline() <<
", "
395 <<
"ID: " <<
Options.getInternalID() <<
", "
396 <<
"Integrity: " <<
Options.getInternalIntegrity() <<
", "
397 <<
"None: " <<
Options.getInternalNone() <<
"\n"
398 <<
"Tag: " <<
Options.getInternalTag() <<
"\n"