Move out of line
[llvm-project.git] / llvm / lib / Target / SPIRV / SPIRVCommandLine.h
blob741d829b2ab8f97b3d9ac22c408aa39b77f491c1
1 //===--- SPIRVCommandLine.h ---- Command Line 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 // 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"
19 #include <set>
21 namespace llvm {
23 /// Command line parser for toggling SPIR-V extensions.
24 struct SPIRVExtensionsParser
25 : public cl::parser<std::set<SPIRV::Extension::Extension>> {
26 public:
27 SPIRVExtensionsParser(cl::Option &O)
28 : cl::parser<std::set<SPIRV::Extension::Extension>>(O) {}
30 /// Parses SPIR-V extension name from CLI arguments.
31 ///
32 /// \return Returns true on error.
33 bool parse(cl::Option &O, StringRef ArgName, StringRef ArgValue,
34 std::set<SPIRV::Extension::Extension> &Vals);
37 } // namespace llvm
38 #endif // LLVM_LIB_TARGET_SPIRV_COMMANDLINE_H