@@ -272,32 +272,35 @@ void PrintPPOutputPPCallbacks::WriteLineInfo(unsigned LineNo,
272272 unsigned ExtraLen) {
273273 startNewLineIfNeeded ();
274274
275- StringRef CurFilenameWithNoLeaningDotSlash =
275+ if (PP.getLangOpts ().isSYCL ()) {
276+ StringRef CurFilenameWithNoLeadingDotSlash =
276277 llvm::sys::path::remove_leading_dotbackslash (CurFilename.str ());
277- if ((CurFilenameWithNoLeaningDotSlash ==
278- PP.getPreprocessorOpts ().IncludeFooter ) ||
279- CurFilenameWithNoLeaningDotSlash ==
280- PP.getPreprocessorOpts ().IncludeHeader ) {
281- CurFilename = " <uninit>" ;
278+ if ((CurFilenameWithNoLeadingDotSlash ==
279+ PP.getPreprocessorOpts ().IncludeFooter ) ||
280+ CurFilenameWithNoLeadingDotSlash ==
281+ PP.getPreprocessorOpts ().IncludeHeader ) {
282+ CurFilename = " <uninit>" ;
283+ }
282284 }
283- // Emit #line directives or GNU line markers depending on what mode we're in.
284- if (UseLineDirectives) {
285- *OS << " #line" << ' ' << LineNo << ' ' << ' "' ;
286- OS->write_escaped (CurFilename);
287- *OS << ' "' ;
288- } else {
289- *OS << ' #' << ' ' << LineNo << ' ' << ' "' ;
290- OS->write_escaped (CurFilename);
291- *OS << ' "' ;
292285
293- if (ExtraLen)
294- OS->write (Extra, ExtraLen);
286+ // Emit #line directives or GNU line markers depending on what mode we're in.
287+ if (UseLineDirectives) {
288+ *OS << " #line" << ' ' << LineNo << ' ' << ' "' ;
289+ OS->write_escaped (CurFilename);
290+ *OS << ' "' ;
291+ } else {
292+ *OS << ' #' << ' ' << LineNo << ' ' << ' "' ;
293+ OS->write_escaped (CurFilename);
294+ *OS << ' "' ;
295+
296+ if (ExtraLen)
297+ OS->write (Extra, ExtraLen);
295298
296- if (FileType == SrcMgr::C_System)
297- OS->write (" 3" , 2 );
298- else if (FileType == SrcMgr::C_ExternCSystem)
299- OS->write (" 3 4" , 4 );
300- }
299+ if (FileType == SrcMgr::C_System)
300+ OS->write (" 3" , 2 );
301+ else if (FileType == SrcMgr::C_ExternCSystem)
302+ OS->write (" 3 4" , 4 );
303+ }
301304
302305 *OS << ' \n ' ;
303306}
0 commit comments