Skip to content

Commit 3b7e458

Browse files
committed
[HLSL] Change clang Driver Options to not set CXXOperatorNames
1 parent fb623a3 commit 3b7e458

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3397,7 +3397,7 @@ def fno_objc_weak : Flag<["-"], "fno-objc-weak">, Group<f_Group>,
33973397
def fno_omit_frame_pointer : Flag<["-"], "fno-omit-frame-pointer">, Group<f_Group>,
33983398
Visibility<[ClangOption, FlangOption]>;
33993399
defm operator_names : BoolFOption<"operator-names",
3400-
LangOpts<"CXXOperatorNames">, Default<cplusplus.KeyPath>,
3400+
LangOpts<"CXXOperatorNames">, Default<!strconcat(cplusplus.KeyPath, " && !",hlsl.KeyPath)>,
34013401
NegFlag<SetFalse, [], [ClangOption, CC1Option],
34023402
"Do not treat C++ operator name keywords as synonyms for operators">,
34033403
PosFlag<SetTrue>>;
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
3+
// RUN: dxil-pc-shadermodel6.3-library %s \
4+
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s
5+
6+
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
7+
// RUN: spirv-unknown-vulkan-compute %s \
8+
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s
9+
10+
// CHECK-LABEL: and
11+
void and() {}
12+
13+
// CHECK-LABEL: and_eq
14+
void and_eq() {}
15+
16+
// CHECK-LABEL: bitand
17+
void bitand() {}
18+
19+
// CHECK-LABEL: bitor
20+
void bitor() {}
21+
22+
// CHECK-LABEL: compl
23+
void compl() {}
24+
25+
// CHECK-LABEL: not
26+
void not() {}
27+
28+
// CHECK-LABEL: not_eq
29+
void not_eq() {}
30+
31+
// CHECK-LABEL: or
32+
void or() {}
33+
34+
// CHECK-LABEL: or_eq
35+
void or_eq() {}
36+
37+
// CHECK-LABEL: xor
38+
void xor() {}
39+
40+
// CHECK-LABEL: xor_eq
41+
void xor_eq() {}

0 commit comments

Comments
 (0)