|
| 1 | +From effb6d2f7668209bc7fc699f8f9ddd10dc26d985 Mon Sep 17 00:00:00 2001 |
| 2 | +From: haonanya <haonan.yang@intel.com> |
| 3 | +Date: Tue, 11 May 2021 10:21:22 +0800 |
| 4 | +Subject: [PATCH] Remove __IMAGE_SUPPORT__ macro for SPIR since SPIR doesn't |
| 5 | + require image support |
| 6 | + |
| 7 | +Signed-off-by: haonanya <haonan.yang@intel.com> |
| 8 | +--- |
| 9 | + clang/lib/Frontend/InitPreprocessor.cpp | 3 --- |
| 10 | + clang/test/Preprocessor/predefined-macros.c | 4 ---- |
| 11 | + 2 files changed, 7 deletions(-) |
| 12 | + |
| 13 | +diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp |
| 14 | +index 6feb7bcbd4b7..564c7fab2b1d 100644 |
| 15 | +--- a/clang/lib/Frontend/InitPreprocessor.cpp |
| 16 | ++++ b/clang/lib/Frontend/InitPreprocessor.cpp |
| 17 | +@@ -1070,9 +1070,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI, |
| 18 | + if (TI.getSupportedOpenCLOpts().isSupported(#Ext, LangOpts)) \ |
| 19 | + Builder.defineMacro(#Ext); |
| 20 | + #include "clang/Basic/OpenCLExtensions.def" |
| 21 | +- |
| 22 | +- if (TI.getTriple().isSPIR()) |
| 23 | +- Builder.defineMacro("__IMAGE_SUPPORT__"); |
| 24 | + } |
| 25 | + |
| 26 | + if (TI.hasInt128Type() && LangOpts.CPlusPlus && LangOpts.GNUMode) { |
| 27 | +diff --git a/clang/test/Preprocessor/predefined-macros.c b/clang/test/Preprocessor/predefined-macros.c |
| 28 | +index def105f4c52e..de6c3fcc48b1 100644 |
| 29 | +--- a/clang/test/Preprocessor/predefined-macros.c |
| 30 | ++++ b/clang/test/Preprocessor/predefined-macros.c |
| 31 | +@@ -171,10 +171,6 @@ |
| 32 | + // MSCOPE:#define __OPENCL_MEMORY_SCOPE_WORK_GROUP 1 |
| 33 | + // MSCOPE:#define __OPENCL_MEMORY_SCOPE_WORK_ITEM 0 |
| 34 | + |
| 35 | +-// RUN: %clang_cc1 %s -E -dM -o - -x cl -triple spir-unknown-unknown \ |
| 36 | +-// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SPIR |
| 37 | +-// CHECK-SPIR: #define __IMAGE_SUPPORT__ 1 |
| 38 | +- |
| 39 | + // RUN: %clang_cc1 %s -E -dM -o - -x hip -triple amdgcn-amd-amdhsa \ |
| 40 | + // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-HIP |
| 41 | + // CHECK-HIP-NOT: #define __CUDA_ARCH__ |
| 42 | +-- |
| 43 | +2.17.1 |
| 44 | + |
0 commit comments