File: Options.h

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (81 lines) | stat: -rw-r--r-- 2,981 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//===-- Options.h -----------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file defines command line options used by llvm-debuginfo-analyzer.
//
//===----------------------------------------------------------------------===//

#ifndef OPTIONS_H
#define OPTIONS_H

#include "llvm/DebugInfo/LogicalView/Core/LVLine.h"
#include "llvm/DebugInfo/LogicalView/Core/LVOptions.h"
#include "llvm/DebugInfo/LogicalView/Core/LVScope.h"
#include "llvm/DebugInfo/LogicalView/Core/LVSymbol.h"
#include "llvm/DebugInfo/LogicalView/Core/LVType.h"
#include "llvm/Support/CommandLine.h"

namespace llvm {
namespace logicalview {
namespace cmdline {

class OffsetParser final : public llvm::cl::parser<unsigned long long> {
public:
  OffsetParser(llvm::cl::Option &O);
  ~OffsetParser() override;

  // Parse an argument representing an offset. Return true on error.
  // If the prefix is 0, the base is octal, if the prefix is 0x or 0X, the
  // base is hexadecimal, otherwise the base is decimal.
  bool parse(llvm::cl::Option &O, StringRef ArgName, StringRef ArgValue,
             unsigned long long &Val);
};

typedef llvm::cl::list<unsigned long long, bool, OffsetParser> OffsetOptionList;

extern llvm::cl::OptionCategory AttributeCategory;
extern llvm::cl::OptionCategory CompareCategory;
extern llvm::cl::OptionCategory OutputCategory;
extern llvm::cl::OptionCategory PrintCategory;
extern llvm::cl::OptionCategory ReportCategory;
extern llvm::cl::OptionCategory SelectCategory;
extern llvm::cl::OptionCategory WarningCategory;
extern llvm::cl::OptionCategory InternalCategory;

extern llvm::cl::list<std::string> InputFilenames;
extern llvm::cl::opt<std::string> OutputFilename;

extern llvm::cl::list<std::string> SelectPatterns;

extern llvm::cl::list<LVElementKind> SelectElements;
extern llvm::cl::list<LVLineKind> SelectLines;
extern llvm::cl::list<LVScopeKind> SelectScopes;
extern llvm::cl::list<LVSymbolKind> SelectSymbols;
extern llvm::cl::list<LVTypeKind> SelectTypes;
extern OffsetOptionList SelectOffsets;

extern llvm::cl::list<LVAttributeKind> AttributeOptions;
extern llvm::cl::list<LVOutputKind> OutputOptions;
extern llvm::cl::list<LVPrintKind> PrintOptions;
extern llvm::cl::list<LVWarningKind> WarningOptions;
extern llvm::cl::list<LVInternalKind> InternalOptions;

extern llvm::cl::list<LVCompareKind> CompareElements;
extern llvm::cl::list<LVReportKind> ReportOptions;

extern LVOptions ReaderOptions;

// Perform any additional post parse command line actions. Propagate the
// values captured by the command line parser, into the generic reader.
void propagateOptions();

} // namespace cmdline
} // namespace logicalview
} // namespace llvm

#endif // OPTIONS_H