| 30 | constexpr auto kDefaultEnvironment = "spv1.6"; |
| 31 | |
| 32 | void print_usage(const char* program) { |
| 33 | std::string target_env_list = spvTargetEnvList(16, 80); |
| 34 | // NOTE: Please maintain flags in lexicographical order. |
| 35 | printf( |
| 36 | R"(%s - Link SPIR-V binary files together. |
| 37 | |
| 38 | USAGE: %s [options] [-o <output>] <input>... |
| 39 | |
| 40 | The SPIR-V binaries are read from the different <input>(s). |
| 41 | The SPIR-V resulting linked binary module is written to the file "out.spv" |
| 42 | unless the -o option is used; if <output> is "-", it is written to the standard |
| 43 | output. |
| 44 | |
| 45 | NOTE: The linker is a work in progress. |
| 46 | |
| 47 | Options (in lexicographical order): |
| 48 | --allow-partial-linkage |
| 49 | Allow partial linkage by accepting imported symbols to be |
| 50 | unresolved. |
| 51 | --allow-pointer-mismatch |
| 52 | Allow pointer function parameters to mismatch the target link |
| 53 | target. This is useful to workaround lost correct parameter type |
| 54 | information due to LLVM's opaque pointers. |
| 55 | --create-library |
| 56 | Link the binaries into a library, keeping all exported symbols. |
| 57 | -h, --help |
| 58 | Print this help. |
| 59 | --target-env <env> |
| 60 | Set the environment used for interpreting the inputs. Without |
| 61 | this option the environment defaults to spv1.6. <env> must be |
| 62 | one of {%s}. |
| 63 | NOTE: The SPIR-V version used by the linked binary module |
| 64 | depends only on the version of the inputs, and is not affected |
| 65 | by this option. |
| 66 | --use-highest-version |
| 67 | Upgrade the output SPIR-V version to the highest of the input |
| 68 | files, instead of requiring all of them to have the same |
| 69 | version. |
| 70 | NOTE: If one of the older input files uses an instruction that |
| 71 | is deprecated in the highest SPIR-V version, the output will |
| 72 | be invalid. |
| 73 | --verify-ids |
| 74 | Verify that IDs in the resulting modules are truly unique. |
| 75 | --fnvar-targets |
| 76 | CSV file specifying OpSpecConditionalTarget parameters for each |
| 77 | linked module. |
| 78 | --fnvar-architectures |
| 79 | CSV file specifying OpSpecConditionalArchitecture parameters for |
| 80 | each linked module. |
| 81 | --fnvar-capabilities |
| 82 | For each function variant, include its required capabilities |
| 83 | under OpSpecConditionalCapabilitiesINTEL. |
| 84 | --version |
| 85 | Display linker version information. |
| 86 | )", |
| 87 | program, program, target_env_list.c_str()); |
| 88 | } |
| 89 |
no test coverage detected