1//===--- SPIR.cpp - Implement SPIR and SPIR-V target feature support ------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements SPIR and SPIR-V TargetInfo objects.
10//
11//===----------------------------------------------------------------------===//
12
13#include "SPIR.h"
14#include "Targets.h"
15
16using namespace clang;
17using namespace clang::targets;
18
19void SPIRTargetInfo::getTargetDefines(const LangOptions &Opts,
20 MacroBuilder &Builder) const {
21 DefineStd(Builder, MacroName: "SPIR", Opts);
22}
23
24void SPIR32TargetInfo::getTargetDefines(const LangOptions &Opts,
25 MacroBuilder &Builder) const {
26 SPIRTargetInfo::getTargetDefines(Opts, Builder);
27 DefineStd(Builder, MacroName: "SPIR32", Opts);
28}
29
30void SPIR64TargetInfo::getTargetDefines(const LangOptions &Opts,
31 MacroBuilder &Builder) const {
32 SPIRTargetInfo::getTargetDefines(Opts, Builder);
33 DefineStd(Builder, MacroName: "SPIR64", Opts);
34}
35
36void BaseSPIRVTargetInfo::getTargetDefines(const LangOptions &Opts,
37 MacroBuilder &Builder) const {
38 DefineStd(Builder, MacroName: "SPIRV", Opts);
39}
40
41void SPIRVTargetInfo::getTargetDefines(const LangOptions &Opts,
42 MacroBuilder &Builder) const {
43 BaseSPIRVTargetInfo::getTargetDefines(Opts, Builder);
44}
45
46void SPIRV32TargetInfo::getTargetDefines(const LangOptions &Opts,
47 MacroBuilder &Builder) const {
48 BaseSPIRVTargetInfo::getTargetDefines(Opts, Builder);
49 DefineStd(Builder, MacroName: "SPIRV32", Opts);
50}
51
52void SPIRV64TargetInfo::getTargetDefines(const LangOptions &Opts,
53 MacroBuilder &Builder) const {
54 BaseSPIRVTargetInfo::getTargetDefines(Opts, Builder);
55 DefineStd(Builder, MacroName: "SPIRV64", Opts);
56}
57

source code of clang/lib/Basic/Targets/SPIR.cpp