Skip to content
Merged
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
18 changes: 12 additions & 6 deletions offload/plugins-nextgen/common/include/ErrorReporting.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,21 @@ class ErrorReporter {
/// Print \p Format, instantiated with \p Args to stderr.
/// TODO: Allow redirection into a file stream.
template <typename... ArgsTy>
[[gnu::format(__printf__, 1, 2)]] static void print(const char *Format,
ArgsTy &&...Args) {
#ifdef __clang__ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77958
[[gnu::format(__printf__, 1, 2)]]
#endif
static void print(const char *Format, ArgsTy &&...Args) {
raw_fd_ostream OS(STDERR_FILENO, false);
OS << llvm::format(Format, Args...);
}

/// Print \p Format, instantiated with \p Args to stderr, but colored.
/// TODO: Allow redirection into a file stream.
template <typename... ArgsTy>
[[gnu::format(__printf__, 2, 3)]] static void
print(ColorTy Color, const char *Format, ArgsTy &&...Args) {
#ifdef __clang__ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77958
[[gnu::format(__printf__, 2, 3)]]
#endif
static void print(ColorTy Color, const char *Format, ArgsTy &&...Args) {
raw_fd_ostream OS(STDERR_FILENO, false);
WithColor(OS, HighlightColor(Color)) << llvm::format(Format, Args...);
}
Expand All @@ -99,8 +103,10 @@ class ErrorReporter {
/// a banner.
/// TODO: Allow redirection into a file stream.
template <typename... ArgsTy>
[[gnu::format(__printf__, 1, 2)]] static void reportError(const char *Format,
ArgsTy &&...Args) {
#ifdef __clang__ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77958
[[gnu::format(__printf__, 1, 2)]]
#endif
static void reportError(const char *Format, ArgsTy &&...Args) {
print(BoldRed, "%s", ErrorBanner);
print(BoldRed, Format, Args...);
print("\n");
Expand Down
4 changes: 2 additions & 2 deletions offload/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CMakeLists.txt file for unit testing OpenMP offloading runtime library.
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0.0)
if(NOT OPENMP_TEST_COMPILER_ID STREQUAL "Clang" OR
OPENMP_TEST_COMPILER_VERSION VERSION_LESS 6.0.0)
message(STATUS "Can only test with Clang compiler in version 6.0.0 or later.")
message(WARNING "The check-offload target will not be available!")
return()
Expand Down