1
- From 8b8ef4b0b24c12d3ab645acabd3cee58bff6ebc9 Mon Sep 17 00:00:00 2001
2
- From: haonanya <
[email protected] >
3
- Date: Sat, 8 May 2021 15:18:02 +0800
4
- Subject: [PATCH] Remove __IMAGE_SUPPORT__ macro for SPIR since SPIR doesn't
5
- require image support
1
+ From 1ca45b5f5725a447ded14c0096df39f2751c4e9a Mon Sep 17 00:00:00 2001
2
+ From: Haonan Yang <
[email protected] >
3
+ Date: Fri, 25 Feb 2022 10:36:57 +0800
4
+ Subject: [PATCH] Remove __IMAGE_SUPPORT__ macro for SPIR
6
5
7
- Signed-off-by:
haonanya <
[email protected] >
6
+ Signed-off-by:
Haonan Yang <
[email protected] >
8
7
---
9
8
clang/lib/Frontend/InitPreprocessor.cpp | 3 ---
10
- clang/test/Preprocessor/predefined-macros.c | 2 --
11
- 2 files changed, 5 deletions(-)
9
+ clang/test/Preprocessor/predefined-macros.c | 4 -- --
10
+ 2 files changed, 7 deletions(-)
12
11
13
12
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
14
- index 41b08ed56134..4e6fc0321b0e 100644
13
+ index e259ab47c558..0bfdd62f17a2 100644
15
14
--- a/clang/lib/Frontend/InitPreprocessor.cpp
16
15
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
17
- @@ -1161 ,9 +1161 ,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
16
+ @@ -1234 ,9 +1234 ,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
18
17
// OpenCL definitions.
19
18
if (LangOpts.OpenCL) {
20
19
InitializeOpenCLFeatureTestMacros(TI, LangOpts, Builder);
21
20
-
22
- - if (TI.getTriple().isSPIR())
21
+ - if (TI.getTriple().isSPIR() || TI.getTriple().isSPIRV() )
23
22
- Builder.defineMacro("__IMAGE_SUPPORT__");
24
23
}
25
24
26
25
if (TI.hasInt128Type() && LangOpts.CPlusPlus && LangOpts.GNUMode) {
27
26
diff --git a/clang/test/Preprocessor/predefined-macros.c b/clang/test/Preprocessor/predefined-macros.c
28
- index e406b9a70570..88606518c7de 100644
27
+ index 0b67cbe233ca..aad4a6f05563 100644
29
28
--- a/clang/test/Preprocessor/predefined-macros.c
30
29
+++ b/clang/test/Preprocessor/predefined-macros.c
31
- @@ -188,14 +188,12 @@
30
+ @@ -207,28 +207,24 @@
32
31
33
32
// RUN: %clang_cc1 %s -E -dM -o - -x cl -triple spir-unknown-unknown \
34
33
// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SPIR
@@ -43,6 +42,20 @@ index e406b9a70570..88606518c7de 100644
43
42
// CHECK-SPIR64-DAG: #define __SPIR__ 1
44
43
// CHECK-SPIR64-DAG: #define __SPIR64__ 1
45
44
// CHECK-SPIR64-NOT: #define __SPIR32__ 1
45
+
46
+ // RUN: %clang_cc1 %s -E -dM -o - -x cl -triple spirv32-unknown-unknown \
47
+ // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SPIRV32
48
+ - // CHECK-SPIRV32-DAG: #define __IMAGE_SUPPORT__ 1
49
+ // CHECK-SPIRV32-DAG: #define __SPIRV__ 1
50
+ // CHECK-SPIRV32-DAG: #define __SPIRV32__ 1
51
+ // CHECK-SPIRV32-NOT: #define __SPIRV64__ 1
52
+
53
+ // RUN: %clang_cc1 %s -E -dM -o - -x cl -triple spirv64-unknown-unknown \
54
+ // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SPIRV64
55
+ - // CHECK-SPIRV64-DAG: #define __IMAGE_SUPPORT__ 1
56
+ // CHECK-SPIRV64-DAG: #define __SPIRV__ 1
57
+ // CHECK-SPIRV64-DAG: #define __SPIRV64__ 1
58
+ // CHECK-SPIRV64-NOT: #define __SPIRV32__ 1
46
59
- -
47
- 2.17.1
60
+ 2.29.2
48
61
0 commit comments