-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove __IMAGE_SUPPORT__ macro for SPIR since SPIR doesn't require im…
…age support Signed-off-by: haonanya <haonan.yang@intel.com>
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
patches/clang/0001-Remove-__IMAGE_SUPPORT__-macro-for-SPIR.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
From 8b8ef4b0b24c12d3ab645acabd3cee58bff6ebc9 Mon Sep 17 00:00:00 2001 | ||
From: haonanya <haonan.yang@intel.com> | ||
Date: Sat, 8 May 2021 15:18:02 +0800 | ||
Subject: [PATCH] Remove __IMAGE_SUPPORT__ macro for SPIR since SPIR doesn't | ||
require image support | ||
|
||
Signed-off-by: haonanya <haonan.yang@intel.com> | ||
--- | ||
clang/lib/Frontend/InitPreprocessor.cpp | 3 --- | ||
clang/test/Preprocessor/predefined-macros.c | 2 -- | ||
2 files changed, 5 deletions(-) | ||
|
||
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp | ||
index 41b08ed56134..4e6fc0321b0e 100644 | ||
--- a/clang/lib/Frontend/InitPreprocessor.cpp | ||
+++ b/clang/lib/Frontend/InitPreprocessor.cpp | ||
@@ -1161,9 +1161,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI, | ||
// OpenCL definitions. | ||
if (LangOpts.OpenCL) { | ||
InitializeOpenCLFeatureTestMacros(TI, LangOpts, Builder); | ||
- | ||
- if (TI.getTriple().isSPIR()) | ||
- Builder.defineMacro("__IMAGE_SUPPORT__"); | ||
} | ||
|
||
if (TI.hasInt128Type() && LangOpts.CPlusPlus && LangOpts.GNUMode) { | ||
diff --git a/clang/test/Preprocessor/predefined-macros.c b/clang/test/Preprocessor/predefined-macros.c | ||
index e406b9a70570..88606518c7de 100644 | ||
--- a/clang/test/Preprocessor/predefined-macros.c | ||
+++ b/clang/test/Preprocessor/predefined-macros.c | ||
@@ -188,14 +188,12 @@ | ||
|
||
// RUN: %clang_cc1 %s -E -dM -o - -x cl -triple spir-unknown-unknown \ | ||
// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SPIR | ||
-// CHECK-SPIR-DAG: #define __IMAGE_SUPPORT__ 1 | ||
// CHECK-SPIR-DAG: #define __SPIR__ 1 | ||
// CHECK-SPIR-DAG: #define __SPIR32__ 1 | ||
// CHECK-SPIR-NOT: #define __SPIR64__ 1 | ||
|
||
// RUN: %clang_cc1 %s -E -dM -o - -x cl -triple spir64-unknown-unknown \ | ||
// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SPIR64 | ||
-// CHECK-SPIR64-DAG: #define __IMAGE_SUPPORT__ 1 | ||
// CHECK-SPIR64-DAG: #define __SPIR__ 1 | ||
// CHECK-SPIR64-DAG: #define __SPIR64__ 1 | ||
// CHECK-SPIR64-NOT: #define __SPIR32__ 1 | ||
-- | ||
2.17.1 | ||
|