clang 24.0.0git
CIRDataLayoutSpec.h
Go to the documentation of this file.
1//===-- CIRDataLayoutSpec.h - DLTI data layout for CIR modules --*- C++ -*-===//
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 a helper that attaches the DLTI data-layout spec,
10// including the CIR-native pointer entry, to a CIR module.
11//
12//===----------------------------------------------------------------------===//
13#ifndef CLANG_CIR_CIRDATALAYOUTSPEC_H
14#define CLANG_CIR_CIRDATALAYOUTSPEC_H
15
16namespace llvm {
17class DataLayout;
18} // namespace llvm
19
20namespace mlir {
21class ModuleOp;
22} // namespace mlir
23
24namespace cir {
25
26/// Translate \p dl into a DLTI data-layout spec and attach it to \p mod.
27/// On top of the plain mlir::translateDataLayout entries this adds a
28/// #cir.ptr_spec entry keyed on !cir.ptr, which CIR pointer types read for
29/// their size and alignment; without it pointer widths default to 64 bits.
30void setMLIRDataLayout(mlir::ModuleOp mod, const llvm::DataLayout &dl);
31
32} // namespace cir
33
34#endif // CLANG_CIR_CIRDATALAYOUTSPEC_H
void setMLIRDataLayout(mlir::ModuleOp mod, const llvm::DataLayout &dl)
Translate dl into a DLTI data-layout spec and attach it to mod.
Diagnostic wrappers for TextAPI types for error reporting.
Definition Dominators.h:30