clang 10.0.0git

OptionUtils.h
Go to the documentation of this file.
1 //===- OptionUtils.h - Utilities for command line arguments -----*- 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 // This header contains utilities for command line arguments.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef LLVM_CLANG_DRIVER_OPTIONUTILS_H
14 #define LLVM_CLANG_DRIVER_OPTIONUTILS_H
15
16 #include "clang/Basic/Diagnostic.h"
17 #include "clang/Basic/LLVM.h"
18 #include "llvm/Option/OptSpecifier.h"
19
20 namespace llvm {
21
22 namespace opt {
23
24 class ArgList;
25
26 } // namespace opt
27
28 } // namespace llvm
29
30 namespace clang {
31 /// Return the value of the last argument as an integer, or a default. If Diags
32 /// is non-null, emits an error if the argument is given, but non-integral.
33 int getLastArgIntValue(const llvm::opt::ArgList &Args,
34 llvm::opt::OptSpecifier Id, int Default,
35 DiagnosticsEngine *Diags = nullptr, unsigned Base = 0);
36
37 inline int getLastArgIntValue(const llvm::opt::ArgList &Args,
38 llvm::opt::OptSpecifier Id, int Default,
39 DiagnosticsEngine &Diags, unsigned Base = 0) {
40 return getLastArgIntValue(Args, Id, Default, &Diags, Base);
41 }
42
43 uint64_t getLastArgUInt64Value(const llvm::opt::ArgList &Args,
44 llvm::opt::OptSpecifier Id, uint64_t Default,
45 DiagnosticsEngine *Diags = nullptr,
46 unsigned Base = 0);
47
48 inline uint64_t getLastArgUInt64Value(const llvm::opt::ArgList &Args,
49 llvm::opt::OptSpecifier Id,
50 uint64_t Default,
51 DiagnosticsEngine &Diags,
52 unsigned Base = 0) {
53 return getLastArgUInt64Value(Args, Id, Default, &Diags, Base);
54 }
55
56 } // namespace clang
57
58 #endif // LLVM_CLANG_DRIVER_OPTIONUTILS_H
llvm
Specialize PointerLikeTypeTraits to allow LazyGenerationalUpdatePtr to be placed into a PointerUnion...
Definition: Dominators.h:30
Base
LLVM.h
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
clang::DiagnosticsEngine
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:149
Diagnostic.h
Defines the Diagnostic-related interfaces.
Id
int Id
Definition: ASTDiff.cpp:190
clang::getLastArgUInt64Value
uint64_t getLastArgUInt64Value(const llvm::opt::ArgList &Args, llvm::opt::OptSpecifier Id, uint64_t Default, DiagnosticsEngine &Diags, unsigned Base=0)
Definition: OptionUtils.h:48
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:21
clang::StructuralEquivalenceKind::Default
clang::getLastArgIntValue
int getLastArgIntValue(const llvm::opt::ArgList &Args, llvm::opt::OptSpecifier Id, int Default, DiagnosticsEngine &Diags, unsigned Base=0)
Definition: OptionUtils.h:37