Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -7557,6 +7557,10 @@ let Visibility = [SYCLRTCOnlyOption] in {
let Group = sycl_rtc_only_Group in {
def auto_pch : Flag<["--"], "auto-pch">,
HelpText<"Enable Auto-PCH for SYCL RTC Compilation">;
def persistent_auto_pch_EQ
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a Driver test similar to this?

: Joined<["--"], "persistent-auto-pch=">,
HelpText<"Use Persistent Auto-PCH cache located at <dir> for SYCL "
"RTC Compilation">;
} // let Group = sycl_rtc_only_Group
} // let Visibility = [SYCLRTCOnlyOption]

Expand Down
2 changes: 2 additions & 0 deletions clang/include/clang/Frontend/PrecompiledPreamble.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ class PrecompiledPreamble {
IntrusiveRefCntPtr<llvm::vfs::FileSystem> &VFS,
llvm::MemoryBuffer *MainFileBuffer) const;

llvm::StringRef memoryContents() const;

private:
PrecompiledPreamble(std::unique_ptr<PCHStorage> Storage,
std::vector<char> PreambleBytes,
Expand Down
4 changes: 4 additions & 0 deletions clang/lib/Frontend/PrecompiledPreamble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,10 @@ void PrecompiledPreamble::OverridePreamble(
configurePreamble(Bounds, CI, VFS, MainFileBuffer);
}

llvm::StringRef PrecompiledPreamble::memoryContents() const {
return Storage->memoryContents();
}

PrecompiledPreamble::PrecompiledPreamble(
std::unique_ptr<PCHStorage> Storage, std::vector<char> PreambleBytes,
bool PreambleEndsAtStartOfLine,
Expand Down
10 changes: 8 additions & 2 deletions clang/test/Driver/sycl-unsupported.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,20 @@
// UNSUPPORTED_OPT-NOT: clang{{.*}} "-fsycl-is-device"{{.*}} "[[OPT_CC1]]{{.*}}"
// UNSUPPORTED_OPT: clang{{.*}} "-fsycl-is-host"{{.*}} "[[OPT_CC1]]{{.*}}"

// "--auto-pch" should only be enabled for SYCL RTC compilations, regular driver
// shouldn't know about it:
// Options that should only be enabled for SYCL RTC compilations, regular driver
// shouldn't know about them:
//
// RUN: not %clangxx -### %s --auto-pch 2>&1 | FileCheck %s --check-prefix AUTO_PCH
// RUN: not %clangxx -fsycl-device-only -### %s --auto-pch 2>&1 | FileCheck %s --check-prefix AUTO_PCH
// RUN: not %clangxx -fsycl -### %s --auto-pch 2>&1 | FileCheck %s --check-prefix AUTO_PCH
//
// AUTO_PCH: error: unknown argument: '--auto-pch'
//
// RUN: not %clangxx -### %s --persistent-auto-pch="%t.dir" 2>&1 | FileCheck %s --check-prefix PERSISTENT_AUTO_PCH
// RUN: not %clangxx -fsycl-device-only -### %s --persistent-auto-pch="%t.dir" 2>&1 | FileCheck %s --check-prefix PERSISTENT_AUTO_PCH
// RUN: not %clangxx -fsycl -### %s --persistent-auto-pch="%t.dir" 2>&1 | FileCheck %s --check-prefix PERSISTENT_AUTO_PCH
//
// PERSISTENT_AUTO_PCH: error: unknown argument: '--persistent-auto-pch={{.*}}'

// FPGA support has been removed, usage of any FPGA specific options and any
// options that have FPGA specific arguments should emit a specific error
Expand Down
Loading
Loading