Skip to content

Commit 382b358

Browse files
mdtoguchiKornevNikita
authored andcommitted
[Driver][SYCL] Do not set workaround predefines with /MDd (#18252)
We are currently setting 2 pre-defines which workaound a compilation issue: -D_CONTAINER_DEBUG_LEVEL=0 and -D_ITERATOR_DEBUG_LEVEL=0. We can no longer rely on these macros as _CONTAINER_DEBUG_LEVEL will be going away with a future release of Visual Studio. The issues that this worked around are detailed in our release notes as a known issue: https://github.com/intel/llvm/blob/aa2c876f529f942943afaf9395694fe07a7f6121/sycl/ReleaseNotes.md?plain=1#L2700 Remove these workarounds in preparation for the upcoming MSVS release.
1 parent 0044b52 commit 382b358

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5346,11 +5346,6 @@ static void ProcessVSRuntimeLibrary(const ToolChain &TC, const ArgList &Args,
53465346
CmdArgs.push_back("-D_MT");
53475347
if (Defines & addDLL && !isSPIROrSPIRV)
53485348
CmdArgs.push_back("-D_DLL");
5349-
// for /MDd with spir targets
5350-
if ((Defines & addDLL) && (Defines & addDEBUG) && isSPIROrSPIRV) {
5351-
CmdArgs.push_back("-D_CONTAINER_DEBUG_LEVEL=0");
5352-
CmdArgs.push_back("-D_ITERATOR_DEBUG_LEVEL=0");
5353-
}
53545349
};
53555350
StringRef FlagForCRT;
53565351
switch (RTOptionID) {

clang/test/Driver/sycl-MD-default.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88
// RUN: %clang_cl -### -fsycl -c %s 2>&1 \
99
// RUN: | FileCheck -check-prefix=CHK-DEFAULT-CL %s
1010
// RUN: %clang_cl -### -MD -fsycl -c %s 2>&1 \
11-
// RUN: | FileCheck -check-prefixes=CHK-DEFAULT-CL,CHK-DEFAULT-CL-MD %s
11+
// RUN: | FileCheck -check-prefixes=CHK-DEFAULT-CL %s
1212
// RUN: %clang_cl -### -MDd -fsycl -c %s 2>&1 \
13-
// RUN: | FileCheck -check-prefixes=CHK-DEFAULT-CL,CHK-DEFAULT-CL-MDd %s
13+
// RUN: | FileCheck -check-prefixes=CHK-DEFAULT-CL %s
1414
// CHK-DEFAULT-CL-NOT: "-fsycl-is-device" {{.*}} "-D_MT" "-D_DLL"
15-
// CHK-DEFAULT-CL-MD-NOT: "-D_CONTAINER_DEBUG_LEVEL=0" "-D_ITERATOR_DEBUG_LEVEL=0"
16-
// CHK-DEFAULT-CL-MDd: "-D_CONTAINER_DEBUG_LEVEL=0" "-D_ITERATOR_DEBUG_LEVEL=0"
1715
// CHK-DEFAULT-CL: "-fsycl-is-host"{{.*}} "-D_MT" "-D_DLL" "--dependent-lib=msvcrt{{d*}}"
1816

1917
// RUN: not %clang_cl -### -MT -fsycl -c %s 2>&1 \

0 commit comments

Comments
 (0)