File tree Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -58,16 +58,16 @@ class JITResult {
5858
5959class RTCResult {
6060public:
61- explicit RTCResult (const char *ErrorMessage )
62- : Failed{true }, BundleInfo{}, ErrorMessage{ErrorMessage } {}
61+ explicit RTCResult (const char *BuildLog )
62+ : Failed{true }, BundleInfo{}, BuildLog{BuildLog } {}
6363
6464 RTCResult (RTCBundleInfo &&BundleInfo, const char *BuildLog)
6565 : Failed{false }, BundleInfo{std::move (BundleInfo)},
66- ErrorMessage {BuildLog} {}
66+ BuildLog {BuildLog} {}
6767
6868 bool failed () const { return Failed; }
6969
70- const char *getErrorMessage () const { return ErrorMessage .c_str (); }
70+ const char *getBuildLog () const { return BuildLog .c_str (); }
7171
7272 const RTCBundleInfo &getBundleInfo () const {
7373 assert (!failed () && " No bundle info" );
@@ -77,7 +77,7 @@ class RTCResult {
7777private:
7878 bool Failed;
7979 RTCBundleInfo BundleInfo;
80- sycl::detail::string ErrorMessage ;
80+ sycl::detail::string BuildLog ;
8181};
8282
8383extern " C" {
Original file line number Diff line number Diff line change @@ -205,8 +205,12 @@ class LLVMDiagnosticWrapper : public llvm::DiagnosticHandler {
205205 return " ERROR" ;
206206 case llvm::DiagnosticSeverity::DS_Warning:
207207 return " WARNING" ;
208- default :
208+ case llvm::DiagnosticSeverity::DS_Note :
209209 return " NOTE:" ;
210+ case llvm::DiagnosticSeverity::DS_Remark:
211+ return " REMARK:" ;
212+ default :
213+ llvm_unreachable (" Unhandled case" );
210214 }
211215 }(DI.getSeverity ());
212216 LogPrinter << Prefix;
@@ -254,16 +258,15 @@ Expected<std::unique_ptr<llvm::Module>> jit_compiler::compileDeviceCode(
254258 IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts{new DiagnosticOptions};
255259 ClangDiagnosticWrapper Wrapper (BuildLog, DiagOpts.get ());
256260 Tool.setDiagnosticConsumer (Wrapper.consumer ());
261+ // Suppress message "Error while processing" being printed to stdout.
262+ Tool.setPrintErrorMessage (false );
257263
258264 // Set up in-memory filesystem.
259265 Tool.mapVirtualFile (SourceFile.Path , SourceFile.Contents );
260266 for (const auto &IF : IncludeFiles) {
261267 Tool.mapVirtualFile (IF.Path , IF.Contents );
262268 }
263269
264- // Suppress message "Error while processing" being printed to stdout.
265- Tool.setPrintErrorMessage (false );
266-
267270 // Reset argument adjusters to drop the `-fsyntax-only` flag which is added by
268271 // default by this API.
269272 Tool.clearArgumentsAdjusters ();
Original file line number Diff line number Diff line change @@ -1243,11 +1243,11 @@ sycl_device_binaries jit_compiler::compileSYCL(
12431243 auto Result = CompileSYCLHandle (SourceFile, IncludeFilesView, UserArgsView);
12441244
12451245 if (LogPtr) {
1246- LogPtr->append (Result.getErrorMessage ());
1246+ LogPtr->append (Result.getBuildLog ());
12471247 }
12481248
12491249 if (Result.failed ()) {
1250- throw sycl::exception (sycl::errc::build, Result.getErrorMessage ());
1250+ throw sycl::exception (sycl::errc::build, Result.getBuildLog ());
12511251 }
12521252
12531253 return createDeviceBinaryImage (Result.getBundleInfo ());
You can’t perform that action at this time.
0 commit comments