@@ -72,6 +72,12 @@ using namespace llvm::util;
7272using namespace llvm ::vfs;
7373using namespace jit_compiler ;
7474
75+ #if defined(__linux__)
76+ #define PRETTY __PRETTY_FUNCTION__
77+ #else
78+ #define PRETTY __FUNCSIG__
79+ #endif
80+
7581namespace {
7682struct AutoPCHError : public ErrorInfo <AutoPCHError> {
7783public:
@@ -282,6 +288,7 @@ class SYCLToolchain {
282288 std::unique_ptr<MemoryBuffer> PrecompiledPreamble,
283289 const PreambleBounds &Bounds, CompilerInvocation &CI,
284290 IntrusiveRefCntPtr<llvm::vfs::FileSystem> &VFS) {
291+ std::cerr << PRETTY << " \n " ;
285292
286293 // Processing similar to PrecompiledPreamble::configurePreamble.
287294
@@ -361,15 +368,18 @@ class SYCLToolchain {
361368 // need this extra `Success` variable to be able to properly return
362369 // compilatoin status.
363370 bool Success = false ;
364- auto RunWithoutPCH = [&]() -> bool {
371+ auto RunWithoutPCH = [&](unsigned LINE = __builtin_LINE ()) -> bool {
372+ std::cerr << PRETTY << " " << LINE << " \n " ;
365373 // Run original invocation:
366374 Success =
367375 Action::runInvocation (std::move (Invocation), Files,
368376 std::move (PCHContainerOps), DiagConsumer);
369377 return Success;
370378 };
371379
372- auto UseCachedPreamble = [&](StringRef PCHContent) {
380+ auto UseCachedPreamble = [&](StringRef PCHContent,
381+ unsigned LINE = __builtin_LINE ()) {
382+ std::cerr << PRETTY << " " << LINE << " \n " ;
373383 std::unique_ptr<MemoryBuffer> PCHMemBuf =
374384 MemoryBuffer::getMemBufferCopy (PCHContent);
375385
@@ -395,6 +405,8 @@ class SYCLToolchain {
395405
396406 auto CacheCallback = [&](size_t , const Twine &,
397407 std::unique_ptr<MemoryBuffer> MB) -> void {
408+ std::cerr << PRETTY << " " << std::boolalpha << CacheHit
409+ << " \n " ;
398410 if (!CacheHit)
399411 return ; // See above.
400412
@@ -468,7 +480,11 @@ class SYCLToolchain {
468480
469481 OS << NewPreamble->memoryContents ();
470482
471- consumeError (CFS->commit ());
483+ auto Err = CFS->commit ();
484+ if (Err) {
485+ std::cerr << " Error in commit\n " ;
486+ }
487+ consumeError (std::move (Err));
472488
473489 return Success;
474490 } else {
0 commit comments