Jlm
Loading...
Searching...
No Matches
TypeConverter.hpp
Go to the documentation of this file.
1/*
2 * Copyright 2025 Nico Reißmann <nico.reissmann@gmail.com>
3 * See COPYING for terms of redistribution.
4 */
5
6#ifndef JLM_LLVM_IR_TYPECONVERTER_HPP
7#define JLM_LLVM_IR_TYPECONVERTER_HPP
8
11
12namespace llvm
13{
14class ArrayType;
15class FunctionType;
16class IntegerType;
17class LLVMContext;
18class PointerType;
19class StructType;
20class Type;
21}
22
23namespace jlm::rvsdg
24{
25class BitType;
26class ControlType;
27class FunctionType;
28class Type;
29}
30
31namespace jlm::llvm
32{
33
37class TypeConverter final
38{
39public:
40 TypeConverter() = default;
41
42 TypeConverter(const TypeConverter &) = delete;
43
44 TypeConverter(const TypeConverter &&) = delete;
45
47 operator=(const TypeConverter &) = delete;
48
50 operator=(const TypeConverter &&) = delete;
51
52 static fpsize
53 ExtractFloatingPointSize(const ::llvm::Type & type);
54
55 static ::llvm::IntegerType *
56 ConvertBitType(const rvsdg::BitType & bitType, ::llvm::LLVMContext & context);
57
58 ::llvm::FunctionType *
59 ConvertFunctionType(const rvsdg::FunctionType & functionType, ::llvm::LLVMContext & context);
60
61 static ::llvm::PointerType *
62 ConvertPointerType(const PointerType & type, ::llvm::LLVMContext & context);
63
64 ::llvm::StructType *
65 ConvertStructType(const StructType & type, ::llvm::LLVMContext & context);
66
67 ::llvm::ArrayType *
68 ConvertArrayType(const ArrayType & type, ::llvm::LLVMContext & context);
69
70 ::llvm::Type *
71 ConvertJlmType(const rvsdg::Type & type, ::llvm::LLVMContext & context);
72
73 std::shared_ptr<const rvsdg::FunctionType>
74 ConvertFunctionType(const ::llvm::FunctionType & functionType);
75
76 static std::shared_ptr<const PointerType>
77 ConvertPointerType(const ::llvm::PointerType & pointerType);
78
79 std::shared_ptr<const rvsdg::Type>
80 ConvertLlvmType(::llvm::Type & type);
81
82private:
83 static ::llvm::Type *
84 ConvertFloatingPointType(const FloatingPointType & type, ::llvm::LLVMContext & context);
85
87};
88
89}
90
91#endif // JLM_LLVM_IR_TYPECONVERTER_HPP
PointerType class.
Definition types.hpp:25
StructType class.
Definition types.hpp:184
::llvm::ArrayType * ConvertArrayType(const ArrayType &type, ::llvm::LLVMContext &context)
::llvm::PointerType * ConvertPointerType(const PointerType &type, ::llvm::LLVMContext &context)
::llvm::IntegerType * ConvertBitType(const rvsdg::BitType &bitType, ::llvm::LLVMContext &context)
::llvm::FunctionType * ConvertFunctionType(const rvsdg::FunctionType &functionType, ::llvm::LLVMContext &context)
TypeConverter & operator=(const TypeConverter &&)=delete
std::shared_ptr< const rvsdg::Type > ConvertLlvmType(::llvm::Type &type)
::llvm::Type * ConvertFloatingPointType(const FloatingPointType &type, ::llvm::LLVMContext &context)
TypeConverter(const TypeConverter &&)=delete
TypeConverter & operator=(const TypeConverter &)=delete
static fpsize ExtractFloatingPointSize(const ::llvm::Type &type)
util::BijectiveMap<::llvm::StructType *, std::shared_ptr< const StructType > > StructTypeMap_
::llvm::StructType * ConvertStructType(const StructType &type, ::llvm::LLVMContext &context)
TypeConverter(const TypeConverter &)=delete
::llvm::Type * ConvertJlmType(const rvsdg::Type &type, ::llvm::LLVMContext &context)
Function type class.
Global memory state passed between functions.