1//===- bolt/Utils/CommandLineOpts.h - BOLT CLI options ----------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// BOLT CLI options
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef BOLT_UTILS_COMMAND_LINE_OPTS_H
14#define BOLT_UTILS_COMMAND_LINE_OPTS_H
15
16#include "llvm/Support/CommandLine.h"
17
18namespace opts {
19
20extern bool HeatmapMode;
21
22extern llvm::cl::OptionCategory BoltCategory;
23extern llvm::cl::OptionCategory BoltDiffCategory;
24extern llvm::cl::OptionCategory BoltOptCategory;
25extern llvm::cl::OptionCategory BoltRelocCategory;
26extern llvm::cl::OptionCategory BoltOutputCategory;
27extern llvm::cl::OptionCategory AggregatorCategory;
28extern llvm::cl::OptionCategory BoltInstrCategory;
29extern llvm::cl::OptionCategory HeatmapCategory;
30
31extern llvm::cl::opt<unsigned> AlignText;
32extern llvm::cl::opt<unsigned> AlignFunctions;
33extern llvm::cl::opt<bool> AggregateOnly;
34extern llvm::cl::opt<unsigned> BucketsPerLine;
35extern llvm::cl::opt<bool> DiffOnly;
36extern llvm::cl::opt<bool> EnableBAT;
37extern llvm::cl::opt<bool> EqualizeBBCounts;
38extern llvm::cl::opt<bool> RemoveSymtab;
39extern llvm::cl::opt<unsigned> ExecutionCountThreshold;
40extern llvm::cl::opt<unsigned> HeatmapBlock;
41extern llvm::cl::opt<unsigned long long> HeatmapMaxAddress;
42extern llvm::cl::opt<unsigned long long> HeatmapMinAddress;
43extern llvm::cl::opt<bool> HotData;
44extern llvm::cl::opt<bool> HotFunctionsAtEnd;
45extern llvm::cl::opt<bool> HotText;
46extern llvm::cl::opt<bool> Hugify;
47extern llvm::cl::opt<bool> Instrument;
48extern llvm::cl::opt<std::string> OutputFilename;
49extern llvm::cl::opt<std::string> PerfData;
50extern llvm::cl::opt<bool> PrintCacheMetrics;
51extern llvm::cl::opt<bool> PrintSections;
52
53// The format to use with -o in aggregation mode (perf2bolt)
54enum ProfileFormatKind { PF_Fdata, PF_YAML };
55
56extern llvm::cl::opt<ProfileFormatKind> ProfileFormat;
57extern llvm::cl::opt<bool> SplitEH;
58extern llvm::cl::opt<bool> StrictMode;
59extern llvm::cl::opt<bool> TimeOpts;
60extern llvm::cl::opt<bool> UseOldText;
61extern llvm::cl::opt<bool> UpdateDebugSections;
62
63// The default verbosity level (0) is pretty terse, level 1 is fairly
64// verbose and usually prints some informational message for every
65// function processed. Level 2 is for the noisiest of messages and
66// often prints a message per basic block.
67// Error messages should never be suppressed by the verbosity level.
68// Only warnings and info messages should be affected.
69//
70// The rationale behind stream usage is as follows:
71// outs() for info and debugging controlled by command line flags.
72// errs() for errors and warnings.
73// dbgs() for output within DEBUG().
74extern llvm::cl::opt<unsigned> Verbosity;
75
76/// Return true if we should process all functions in the binary.
77bool processAllFunctions();
78
79} // namespace opts
80
81namespace llvm {
82namespace bolt {
83extern const char *BoltRevision;
84}
85} // namespace llvm
86
87#endif
88

source code of bolt/include/bolt/Utils/CommandLineOpts.h