clang 20.0.0 (based on r547379) from build 12806354. Bug: http://b/379133546 Test: N/A Change-Id: I2eb8938af55d809de674be63cb30cf27e801862b Upstream-Commit: ad834e67b1105d15ef907f6255d4c96e8e733f57
70 lines
2.6 KiB
C++
70 lines
2.6 KiB
C++
//===----- SemaSYCL.h ------- Semantic Analysis for SYCL constructs -------===//
|
|
//
|
|
// 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
/// \file
|
|
/// This file declares semantic analysis for SYCL constructs.
|
|
///
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_CLANG_SEMA_SEMASYCL_H
|
|
#define LLVM_CLANG_SEMA_SEMASYCL_H
|
|
|
|
#include "clang/AST/ASTFwd.h"
|
|
#include "clang/AST/Type.h"
|
|
#include "clang/Basic/SourceLocation.h"
|
|
#include "clang/Sema/Ownership.h"
|
|
#include "clang/Sema/SemaBase.h"
|
|
#include "llvm/ADT/DenseSet.h"
|
|
|
|
namespace clang {
|
|
class Decl;
|
|
class ParsedAttr;
|
|
|
|
class SemaSYCL : public SemaBase {
|
|
public:
|
|
SemaSYCL(Sema &S);
|
|
|
|
/// Creates a SemaDiagnosticBuilder that emits the diagnostic if the current
|
|
/// context is "used as device code".
|
|
///
|
|
/// - If CurLexicalContext is a kernel function or it is known that the
|
|
/// function will be emitted for the device, emits the diagnostics
|
|
/// immediately.
|
|
/// - If CurLexicalContext is a function and we are compiling
|
|
/// for the device, but we don't know yet that this function will be
|
|
/// codegen'ed for the devive, creates a diagnostic which is emitted if and
|
|
/// when we realize that the function will be codegen'ed.
|
|
///
|
|
/// Example usage:
|
|
///
|
|
/// Diagnose __float128 type usage only from SYCL device code if the current
|
|
/// target doesn't support it
|
|
/// if (!S.Context.getTargetInfo().hasFloat128Type() &&
|
|
/// S.getLangOpts().SYCLIsDevice)
|
|
/// DiagIfDeviceCode(Loc, diag::err_type_unsupported) << "__float128";
|
|
SemaDiagnosticBuilder DiagIfDeviceCode(SourceLocation Loc, unsigned DiagID);
|
|
|
|
void deepTypeCheckForDevice(SourceLocation UsedAt,
|
|
llvm::DenseSet<QualType> Visited,
|
|
ValueDecl *DeclToCheck);
|
|
|
|
ExprResult BuildUniqueStableNameExpr(SourceLocation OpLoc,
|
|
SourceLocation LParen,
|
|
SourceLocation RParen,
|
|
TypeSourceInfo *TSI);
|
|
ExprResult ActOnUniqueStableNameExpr(SourceLocation OpLoc,
|
|
SourceLocation LParen,
|
|
SourceLocation RParen,
|
|
ParsedType ParsedTy);
|
|
|
|
void handleKernelAttr(Decl *D, const ParsedAttr &AL);
|
|
};
|
|
|
|
} // namespace clang
|
|
|
|
#endif // LLVM_CLANG_SEMA_SEMASYCL_H
|