clang 22.0.0git
CIRTypes.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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 declares the types in the CIR dialect.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef CLANG_CIR_DIALECT_IR_CIRTYPES_H
14#define CLANG_CIR_DIALECT_IR_CIRTYPES_H
15
16#include "mlir/IR/Attributes.h"
17#include "mlir/IR/BuiltinAttributes.h"
18#include "mlir/IR/MLIRContext.h"
19#include "mlir/IR/Types.h"
20#include "mlir/Interfaces/DataLayoutInterfaces.h"
25
26namespace cir {
27
28namespace detail {
30} // namespace detail
31
32bool isValidFundamentalIntWidth(unsigned width);
33
34/// Returns true if the type is a CIR sized type.
35///
36/// Types are sized if they implement SizedTypeInterface and
37/// return true from its method isSized.
38///
39/// Unsized types are those that do not have a size, such as
40/// void, or abstract types.
41bool isSized(mlir::Type ty);
42
43//===----------------------------------------------------------------------===//
44// AddressSpace helpers
45//===----------------------------------------------------------------------===//
46cir::TargetAddressSpaceAttr toCIRTargetAddressSpace(mlir::MLIRContext &context,
47 clang::LangAS langAS);
48
49bool isMatchingAddressSpace(cir::TargetAddressSpaceAttr cirAS,
50 clang::LangAS as);
51
52} // namespace cir
53
54//===----------------------------------------------------------------------===//
55// CIR Dialect Tablegen'd Types
56//===----------------------------------------------------------------------===//
57
58namespace cir {
59
60#include "clang/CIR/Dialect/IR/CIRTypeConstraints.h.inc"
61
62} // namespace cir
63
64#define GET_TYPEDEF_CLASSES
65#include "clang/CIR/Dialect/IR/CIROpsTypes.h.inc"
66
67#endif // CLANG_CIR_DIALECT_IR_CIRTYPES_H
Provides definitions for the various language-specific address spaces.
bool isValidFundamentalIntWidth(unsigned width)
Definition CIRTypes.cpp:518
bool isSized(mlir::Type ty)
Returns true if the type is a CIR sized type.
Definition CIRTypes.cpp:30
bool isMatchingAddressSpace(cir::TargetAddressSpaceAttr cirAS, clang::LangAS as)
Definition CIRTypes.cpp:823
cir::TargetAddressSpaceAttr toCIRTargetAddressSpace(mlir::MLIRContext &context, clang::LangAS langAS)
Definition CIRTypes.cpp:816
LangAS
Defines the address space values used by the address space qualifier of QualType.
Type storage for CIR record types.