MLIR
20.0.0git
include
mlir
Target
LLVMIR
TypeFromLLVM.h
Go to the documentation of this file.
1
//===- TypeFromLLVM.h - Translate types from LLVM to MLIR --*- 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 the type translation function going from MLIR LLVM dialect
10
// to LLVM IR and back.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef MLIR_TARGET_LLVMIR_TYPEFROMLLVM_H
15
#define MLIR_TARGET_LLVMIR_TYPEFROMLLVM_H
16
17
#include <memory>
18
19
namespace
llvm
{
20
class
DataLayout;
21
class
LLVMContext;
22
class
Type
;
23
}
// namespace llvm
24
25
namespace
mlir
{
26
27
class
Type
;
28
class
MLIRContext;
29
30
namespace
LLVM {
31
32
namespace
detail {
33
class
TypeFromLLVMIRTranslatorImpl;
34
}
// namespace detail
35
36
/// Utility class to translate LLVM IR types to the MLIR LLVM dialect. Stores
37
/// the translation state, in particular any identified structure types that are
38
/// reused across translations.
39
class
TypeFromLLVMIRTranslator
{
40
public
:
41
TypeFromLLVMIRTranslator
(
MLIRContext
&context);
42
~TypeFromLLVMIRTranslator
();
43
44
/// Translates the given LLVM IR type to the MLIR LLVM dialect.
45
Type
translateType
(llvm::Type *type);
46
47
private
:
48
/// Private implementation.
49
std::unique_ptr<detail::TypeFromLLVMIRTranslatorImpl>
impl
;
50
};
51
52
}
// namespace LLVM
53
}
// namespace mlir
54
55
#endif
// MLIR_TARGET_LLVMIR_TYPEFROMLLVM_H
mlir::LLVM::TypeFromLLVMIRTranslator
Utility class to translate LLVM IR types to the MLIR LLVM dialect.
Definition:
TypeFromLLVM.h:39
mlir::LLVM::TypeFromLLVMIRTranslator::translateType
Type translateType(llvm::Type *type)
Translates the given LLVM IR type to the MLIR LLVM dialect.
Definition:
TypeFromLLVM.cpp:171
mlir::LLVM::TypeFromLLVMIRTranslator::~TypeFromLLVMIRTranslator
~TypeFromLLVMIRTranslator()
mlir::LLVM::TypeFromLLVMIRTranslator::TypeFromLLVMIRTranslator
TypeFromLLVMIRTranslator(MLIRContext &context)
Definition:
TypeFromLLVM.cpp:166
mlir::MLIRContext
MLIRContext is the top-level object for a collection of MLIR operations.
Definition:
MLIRContext.h:60
mlir::Type
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
Definition:
Types.h:74
impl
Definition:
RunnerUtils.h:80
llvm
The OpAsmOpInterface, see OpAsmInterface.td for more details.
Definition:
CallGraph.h:229
mlir::lsp::InlayHintKind::Type
@ Type
An inlay hint that for a type annotation.
mlir
Include the generated interface declarations.
Definition:
LocalAliasAnalysis.h:20
Generated on Tue Dec 24 2024 16:31:43 for MLIR by
1.9.1