CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
93 lines
3.3 KiB
C++
93 lines
3.3 KiB
C++
//===--- ExprConstShared.h - Shared consetxpr functionality ----*- C++ -*-===//
|
|
//
|
|
// 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Shared functionality between the new constant expression
|
|
// interpreter (AST/ByteCode/) and the current one (ExprConstant.cpp).
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_CLANG_LIB_AST_EXPRCONSTSHARED_H
|
|
#define LLVM_CLANG_LIB_AST_EXPRCONSTSHARED_H
|
|
|
|
#include "clang/Basic/TypeTraits.h"
|
|
#include <cstdint>
|
|
#include <optional>
|
|
|
|
namespace llvm {
|
|
class APFloat;
|
|
class APSInt;
|
|
class APInt;
|
|
}
|
|
namespace clang {
|
|
class QualType;
|
|
class LangOptions;
|
|
class ASTContext;
|
|
class CharUnits;
|
|
class Expr;
|
|
} // namespace clang
|
|
using namespace clang;
|
|
/// Values returned by __builtin_classify_type, chosen to match the values
|
|
/// produced by GCC's builtin.
|
|
enum class GCCTypeClass {
|
|
None = -1,
|
|
Void = 0,
|
|
Integer = 1,
|
|
// GCC reserves 2 for character types, but instead classifies them as
|
|
// integers.
|
|
Enum = 3,
|
|
Bool = 4,
|
|
Pointer = 5,
|
|
// GCC reserves 6 for references, but appears to never use it (because
|
|
// expressions never have reference type, presumably).
|
|
PointerToDataMember = 7,
|
|
RealFloat = 8,
|
|
Complex = 9,
|
|
// GCC reserves 10 for functions, but does not use it since GCC version 6 due
|
|
// to decay to pointer. (Prior to version 6 it was only used in C++ mode).
|
|
// GCC claims to reserve 11 for pointers to member functions, but *actually*
|
|
// uses 12 for that purpose, same as for a class or struct. Maybe it
|
|
// internally implements a pointer to member as a struct? Who knows.
|
|
PointerToMemberFunction = 12, // Not a bug, see above.
|
|
ClassOrStruct = 12,
|
|
Union = 13,
|
|
// GCC reserves 14 for arrays, but does not use it since GCC version 6 due to
|
|
// decay to pointer. (Prior to version 6 it was only used in C++ mode).
|
|
// GCC reserves 15 for strings, but actually uses 5 (pointer) for string
|
|
// literals.
|
|
// Lang = 16,
|
|
// OpaqueType = 17,
|
|
BitInt = 18,
|
|
Vector = 19
|
|
};
|
|
|
|
GCCTypeClass EvaluateBuiltinClassifyType(QualType T,
|
|
const LangOptions &LangOpts);
|
|
|
|
void HandleComplexComplexMul(llvm::APFloat A, llvm::APFloat B, llvm::APFloat C,
|
|
llvm::APFloat D, llvm::APFloat &ResR,
|
|
llvm::APFloat &ResI);
|
|
void HandleComplexComplexDiv(llvm::APFloat A, llvm::APFloat B, llvm::APFloat C,
|
|
llvm::APFloat D, llvm::APFloat &ResR,
|
|
llvm::APFloat &ResI);
|
|
|
|
CharUnits GetAlignOfExpr(const ASTContext &Ctx, const Expr *E,
|
|
UnaryExprOrTypeTrait ExprKind);
|
|
|
|
uint8_t GFNIMultiplicativeInverse(uint8_t Byte);
|
|
uint8_t GFNIMul(uint8_t AByte, uint8_t BByte);
|
|
uint8_t GFNIAffine(uint8_t XByte, const llvm::APInt &AQword,
|
|
const llvm::APSInt &Imm, bool Inverse = false);
|
|
llvm::APSInt NormalizeRotateAmount(const llvm::APSInt &Value,
|
|
const llvm::APSInt &Amount);
|
|
|
|
std::optional<llvm::APFloat>
|
|
EvalScalarMinMaxFp(const llvm::APFloat &A, const llvm::APFloat &B,
|
|
std::optional<llvm::APSInt> RoundingMode, bool IsMin);
|
|
|
|
#endif
|