@@ -150,7 +150,7 @@ jit_compiler::compileDeviceCode(InMemoryFile SourceFile,
150150 return createStringError (" Unable to obtain LLVM module" );
151151}
152152
153- Error jit_compiler::linkDefaultDeviceLibraries (llvm::Module * Module,
153+ Error jit_compiler::linkDefaultDeviceLibraries (llvm::Module & Module,
154154 View<const char *> UserArgs) {
155155 // This function mimics the device library selection process
156156 // `clang::driver::tools::SYCL::getDeviceLibraries`, assuming a SPIR-V target
@@ -195,22 +195,21 @@ Error jit_compiler::linkDefaultDeviceLibraries(llvm::Module *Module,
195195 " libsycl-itt-user-wrappers" , " libsycl-itt-compiler-wrappers" ,
196196 " libsycl-itt-stubs" };
197197
198- LLVMContext &Ctx = Module-> getContext ();
198+ LLVMContext &Context = Module. getContext ();
199199 auto Link = [&](ArrayRef<llvm::StringLiteral> LibNames) -> Error {
200200 for (const auto &LibName : LibNames) {
201201 std::string LibPath = (DPCPPRoot + " /lib/" + LibName + " .bc" ).str ();
202202
203203 SMDiagnostic Diag;
204- std::unique_ptr<llvm::Module> Lib = parseIRFile (LibPath, Diag, Ctx );
204+ std::unique_ptr<llvm::Module> Lib = parseIRFile (LibPath, Diag, Context );
205205 if (!Lib) {
206206 std::string DiagMsg;
207207 raw_string_ostream SOS (DiagMsg);
208208 Diag.print (/* ProgName=*/ nullptr , SOS);
209209 return createStringError (DiagMsg);
210210 }
211211
212- if (Linker::linkModules (*Module, std::move (Lib),
213- Linker::LinkOnlyNeeded)) {
212+ if (Linker::linkModules (Module, std::move (Lib), Linker::LinkOnlyNeeded)) {
214213 // TODO: `linkModules` always prints errors to the console.
215214 return createStringError (" Unable to link device library: %s" ,
216215 LibPath.c_str ());
0 commit comments