6 #ifndef CHI_DATA_TYPE_HPP 7 #define CHI_DATA_TYPE_HPP 23 DataType(
ChiModule* chiMod =
nullptr, std::string typeName = {}, llvm::Type* llvmtype =
nullptr,
24 llvm::DIType* debugTy =
nullptr)
25 : mModule(chiMod), mName{typeName}, mLLVMType{llvmtype}, mDIType{debugTy} {}
38 llvm::Type*
llvmType()
const {
return mLLVMType; }
45 return mModule !=
nullptr && mName !=
"" && mLLVMType !=
nullptr && mDIType !=
nullptr;
51 llvm::Type* mLLVMType;
52 llvm::DIType* mDIType;
80 bool valid()
const {
return type.valid(); }
106 #endif // CHI_DATA_TYPE_HPP ChiModule & module() const
Get the module this is a part of.
Forward declares all the chigraph data types.
llvm::Type * llvmType() const
Get the underlying llvm::Type.
bool operator!=(const DataType &lhs, const DataType &rhs)
Inequality check.
bool valid() const
See if the pair is valid.
NamedDataType(std::string n={}, DataType ty={})
Construct a NamedDataType from the name and the type.
Basicaly a std::pair<std::string, DataType>, except it has nicer names.
bool operator!=(const NamedDataType &lhs, const NamedDataType &rhs)
Check if two NamedDataType objects aren't equal.
An abstract class that represents a module of code in Chigraph Can be compiled to a llvm::Module...
DataType(ChiModule *chiMod=nullptr, std::string typeName={}, llvm::Type *llvmtype=nullptr, llvm::DIType *debugTy=nullptr)
Constructor.
std::string qualifiedName() const
Get the qualified name of the type (module().fullName() + ":" name())
const std::string & unqualifiedName() const
Get the unqualified name of the type.
llvm::DIType * debugType() const
Get the debug type.
bool operator==(const NamedDataType &lhs, const NamedDataType &rhs)
Check if two NamedDataType objects are equal.
bool valid() const
Check if the DataType is valid (if it's actually bound to a type and module)
std::string name
The name.
The namespace where chigraph lives.
A type of data Loose wrapper around llvm::Type*, except it knows which ChiModule it's in and it embed...
bool operator==(const DataType &lhs, const DataType &rhs)
Equality check.