1 //===--- SPIRVCommandLine.h ---- Command Line Options -----------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file contains classes and functions needed for processing, parsing, and
10 // using CLI options for the SPIR-V backend.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_SPIRV_COMMANDLINE_H
15 #define LLVM_LIB_TARGET_SPIRV_COMMANDLINE_H
17 #include "MCTargetDesc/SPIRVBaseInfo.h"
18 #include "llvm/Support/CommandLine.h"
23 /// Command line parser for toggling SPIR-V extensions.
24 struct SPIRVExtensionsParser
25 : public cl::parser
<std::set
<SPIRV::Extension::Extension
>> {
27 SPIRVExtensionsParser(cl::Option
&O
)
28 : cl::parser
<std::set
<SPIRV::Extension::Extension
>>(O
) {}
30 /// Parses SPIR-V extension name from CLI arguments.
32 /// \return Returns true on error.
33 bool parse(cl::Option
&O
, StringRef ArgName
, StringRef ArgValue
,
34 std::set
<SPIRV::Extension::Extension
> &Vals
);
38 #endif // LLVM_LIB_TARGET_SPIRV_COMMANDLINE_H