diff options
author | Alexey Bader <alexey.bader@intel.com> | 2016-02-20 13:22:41 +0300 |
---|---|---|
committer | Alexey Bader <alexey.bader@intel.com> | 2016-02-20 13:22:41 +0300 |
commit | 1a9f8bfb5f39fc7a0e392d1e6d03066b31e3eb12 (patch) | |
tree | 7d2e98f5921834639db15da290f7ca4f8f76392b /tools | |
parent | 704ac1fc003de1e46cd8de13a5e76b847ac698c7 (diff) |
Use ".spt" default file extension for output file if '-spirv-text' option is set.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-spirv/llvm-spirv.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/llvm-spirv/llvm-spirv.cpp b/tools/llvm-spirv/llvm-spirv.cpp index 906f718..436af59 100644 --- a/tools/llvm-spirv/llvm-spirv.cpp +++ b/tools/llvm-spirv/llvm-spirv.cpp @@ -93,6 +93,11 @@ IsRegularization("s", cl::desc( "Regularize LLVM to be representable by SPIR-V"));
#ifdef _SPIRV_SUPPORT_TEXT_FMT
+namespace SPIRV {
+// Use textual format for SPIRV.
+extern bool SPIRVUseTextFormat;
+}
+
static cl::opt<bool>
ToText("to-text", cl::desc("Convert input SPIR-V binary to internal textual format"));
@@ -139,7 +144,8 @@ convertLLVMToSPIRV() { if (InputFile == "-")
OutputFile = "-";
else
- OutputFile = removeExt(InputFile) + kExt::SpirvBinary;
+ OutputFile = removeExt(InputFile) +
+ (SPIRV::SPIRVUseTextFormat ? kExt::SpirvText : kExt::SpirvBinary);
}
llvm::StringRef outFile(OutputFile);
|