Skip to content

Commit 11ccf62

Browse files
[SYCL-JIT][NFCI] Enable few extra warnings (#19118)
Those extra flags are required per our internal guidelines (the full list you can find in `llvm/cmake/modules/AddSecurityFlags.cmake`. Even though we have this shared cmake module that applies those flags, I don't think that we will be able to use it for every flag, because baseline LLVM that we use isn't warning-free. Therefore, those flags were directly applied to `sycl-jit`.
1 parent 8e1b9a9 commit 11ccf62

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

sycl-jit/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set(LLVM_SPIRV_INCLUDE_DIRS "${LLVM_MAIN_SRC_DIR}/../llvm-spirv/include")
1111

1212
if (NOT WIN32 AND NOT CYGWIN)
1313
# Set library-wide warning options.
14-
set(SYCL_JIT_WARNING_FLAGS -Wall -Wextra)
14+
set(SYCL_JIT_WARNING_FLAGS -Wall -Wextra -Wconversion -Wimplicit-fallthrough)
1515

1616
option(SYCL_JIT_ENABLE_WERROR "Treat all warnings as errors in SYCL JIT library" ON)
1717
if(SYCL_JIT_ENABLE_WERROR)

sycl-jit/jit-compiler/include/DynArray.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include <algorithm>
1212
#include <cstring>
13+
#include <iterator>
1314

1415
namespace jit_compiler {
1516

@@ -22,7 +23,7 @@ template <typename T> class DynArray {
2223
explicit DynArray(size_t Size) { init(Size); }
2324

2425
template <typename InputIt> DynArray(InputIt Begin, InputIt End) {
25-
init(End - Begin);
26+
init(static_cast<size_t>(End - Begin));
2627
std::copy(Begin, End, this->begin());
2728
}
2829

sycl-jit/jit-compiler/lib/rtc/RTC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ JIT_EXPORT_SYMBOL RTCResult compileSYCL(InMemoryFile SourceFile,
7171
if (auto *Arg =
7272
UserArgList.getLastArg(clang::driver::options::OPT_ftime_trace_EQ)) {
7373
TraceFileName = Arg->getValue();
74-
int Granularity =
74+
unsigned Granularity =
7575
500; // microseconds. Same default as in `clang::FrontendOptions`.
7676
if (auto *Arg = UserArgList.getLastArg(
7777
clang::driver::options::OPT_ftime_trace_granularity_EQ)) {

0 commit comments

Comments
 (0)