LLVM 24.0.0git
SPIRVCommandLine.h
Go to the documentation of this file.
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.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_SPIRV_SPIRVCOMMANDLINE_H
15#define LLVM_LIB_TARGET_SPIRV_SPIRVCOMMANDLINE_H
16
18#include <string>
19
20namespace llvm {
21template <typename T> class ArrayRef;
22class Error;
23class StringRef;
24class Triple;
25
26/// Parser for toggling SPIR-V extensions.
28 /// Parses the value of -spirv-ext into \p Enabled and \p Disabled.
29 static Error parse(StringRef ArgValue, ExtensionSet &Enabled,
31
32 /// Validates and converts extension names into internal enum values.
33 ///
34 /// \return Returns a reference to the unknown SPIR-V extension name from the
35 /// list if present, or an empty StringRef on success.
37 ExtensionSet &AllowedExtensions);
38
39 /// Returns the list of extensions that are valid for a particular
40 /// target environment (i.e., OpenCL or Vulkan), excluding \p Disabled.
41 static ExtensionSet getValidExtensions(const Triple &TT,
42 const ExtensionSet &Disabled);
43};
44
45} // namespace llvm
46#endif // LLVM_LIB_TARGET_SPIRV_SPIRVCOMMANDLINE_H
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
This is an optimization pass for GlobalISel generic memory operations.
DenseSet< SPIRV::Extension::Extension > ExtensionSet
@ Enabled
Convert any .debug_str_offsets tables to DWARF64 if needed.
Definition DWP.h:31
@ Disabled
Don't do any conversion of .debug_str_offsets tables.
Definition DWP.h:30
Parser for toggling SPIR-V extensions.
static StringRef checkExtensions(ArrayRef< std::string > ExtNames, ExtensionSet &AllowedExtensions)
Validates and converts extension names into internal enum values.
static ExtensionSet getValidExtensions(const Triple &TT, const ExtensionSet &Disabled)
Returns the list of extensions that are valid for a particular target environment (i....
static Error parse(StringRef ArgValue, ExtensionSet &Enabled, ExtensionSet &Disabled)
Parses the value of -spirv-ext into Enabled and Disabled.