Skip to content

Commit 98d8c03

Browse files
Update common_clang.cpp
Co-Authored-By: Alexey Sotkin <[email protected]>
1 parent 0fecc48 commit 98d8c03

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

common_clang.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,12 @@ Compile(const char *pszProgramSource, const char **pInputHeaders,
325325
SmallVectorBuffer StreamBuf(pResult->getIRBufferRef());
326326
std::ostream OS(&StreamBuf);
327327
std::string Err;
328-
if (!(optionsParser.hasOptDisable())){
329-
SPIRV::TranslatorOpts OCLOpts;
330-
OCLOpts.enableAllExtensions();
331-
OCLOpts.setMemToRegEnabled(true);
332-
success = llvm::writeSpirv(M.get(), OCLOpts, OS, Err);
328+
SPIRV::TranslatorOpts SPIRVOpts;
329+
SPIRVOpts.enableAllExtensions();
330+
if (!optionsParser.hasOptDisable()) {
331+
SPIRVOpts.setMemToRegEnabled(true);
333332
}
334-
else
335-
success = llvm::writeSpirv(M.get(), OS, Err);
333+
success = llvm::writeSpirv(M.get(), SPIRVOpts, OS, Err);
336334
err_ostream << Err.c_str();
337335
err_ostream.flush();
338336
}

0 commit comments

Comments
 (0)