
- fixes #132303 - Moves dot2add from a language builtin to a target builtin. - Sets the scaffolding for Sema checks for DX builtins - Setup DirectX backend as able to have target builtins - Adds a DX TargetBuiltins emitter in `clang/lib/CodeGen/TargetBuiltins/DirectX.cpp`
43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
//===--- DirectX.cpp - Implement DirectX target feature support -----------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file implements DirectX TargetInfo objects.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "DirectX.h"
|
|
#include "Targets.h"
|
|
#include "clang/Basic/TargetBuiltins.h"
|
|
|
|
using namespace clang;
|
|
using namespace clang::targets;
|
|
|
|
static constexpr int NumBuiltins =
|
|
clang::DirectX::LastTSBuiltin - Builtin::FirstTSBuiltin;
|
|
|
|
#define GET_BUILTIN_STR_TABLE
|
|
#include "clang/Basic/BuiltinsDirectX.inc"
|
|
#undef GET_BUILTIN_STR_TABLE
|
|
|
|
static constexpr Builtin::Info BuiltinInfos[] = {
|
|
#define GET_BUILTIN_INFOS
|
|
#include "clang/Basic/BuiltinsDirectX.inc"
|
|
#undef GET_BUILTIN_INFOS
|
|
};
|
|
static_assert(std::size(BuiltinInfos) == NumBuiltins);
|
|
|
|
void DirectXTargetInfo::getTargetDefines(const LangOptions &Opts,
|
|
MacroBuilder &Builder) const {
|
|
DefineStd(Builder, "DIRECTX", Opts);
|
|
}
|
|
|
|
llvm::SmallVector<Builtin::InfosShard>
|
|
DirectXTargetInfo::getTargetBuiltins() const {
|
|
return {{&BuiltinStrings, BuiltinInfos}};
|
|
}
|