12#include "llvm/Option/ArgList.h"
18template <
typename IntTy>
19IntTy getLastArgIntValueImpl(
const ArgList &Args, OptSpecifier
Id,
23 if (Arg *A = Args.getLastArg(
Id)) {
24 if (StringRef(A->getValue()).getAsInteger(
Base, Res)) {
26 Diags->
Report(diag::err_drv_invalid_int_value)
27 << A->getAsString(Args) << A->getValue();
38 return getLastArgIntValueImpl<int>(Args,
Id,
Default, Diags,
Base);
44 return getLastArgIntValueImpl<uint64_t>(Args,
Id,
Default, Diags,
Base);
Defines the Diagnostic-related interfaces.
Concrete class used by the front-end to report problems and issues.
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
The JSON file list parser is used to communicate input to InstallAPI.
uint64_t getLastArgUInt64Value(const llvm::opt::ArgList &Args, llvm::opt::OptSpecifier Id, uint64_t Default, DiagnosticsEngine *Diags=nullptr, unsigned Base=0)
int getLastArgIntValue(const llvm::opt::ArgList &Args, llvm::opt::OptSpecifier Id, int Default, DiagnosticsEngine *Diags=nullptr, unsigned Base=0)
Return the value of the last argument as an integer, or a default.