Skip to content

Commit 0fe726f

Browse files
authored
Add -emit-opaque-pointers flag (#1545)
This option is useful for testing opaque pointers support and controlled transition of lit tests.
1 parent e66b2d6 commit 0fe726f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/llvm-spirv/llvm-spirv.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ static cl::opt<bool>
153153
SPIRVToolsDis("spirv-tools-dis", cl::init(false),
154154
cl::desc("Emit textual assembly using SPIRV-Tools"));
155155

156+
static cl::opt<bool>
157+
EmitOpaquePointers("emit-opaque-pointers", cl::init(false),
158+
cl::desc("Emit opaque instead of typed LLVM pointers "
159+
"for the translation from SPIR-V."),
160+
cl::Hidden);
161+
156162
using SPIRV::ExtensionID;
157163

158164
#ifdef _SPIRV_SUPPORT_TEXT_FMT
@@ -344,7 +350,7 @@ static bool isFileEmpty(const std::string &FileName) {
344350

345351
static int convertSPIRVToLLVM(const SPIRV::TranslatorOpts &Opts) {
346352
LLVMContext Context;
347-
Context.setOpaquePointers(false);
353+
Context.setOpaquePointers(EmitOpaquePointers);
348354

349355
std::ifstream IFS(InputFile, std::ios::binary);
350356
Module *M;

0 commit comments

Comments
 (0)