Commit 716b5bec authored by Bednárek David RNDr. Ph.D.'s avatar Bednárek David RNDr. Ph.D.
Browse files

fmwk: Null value support

parent 7e671b3a
......@@ -190,6 +190,12 @@ namespace cecko {
return llvm::cast<llvm::ConstantInt>(v);
}
/// Get null value for a llvm::Type
inline CKIRConstantObs CKIRNullValue(CKIRTypeObs t)
{
return llvm::Constant::getNullValue(t);
}
/// @cond INTERNAL
CKIRConstantObs CKCreateGlobalVariable(CKIRTypeObs irtp, const std::string& name, CKIRModuleObs M);
......
......@@ -32,6 +32,11 @@ namespace cecko {
return generate_dump_name(*name_ptr_, def_loc_);
}
CKIRConstantObs CIAbstractType::get_null_value() const
{
return CKIRNullValue(get_ir());
}
CIDecl CKVoidType::declaration(bool is_const, const CIDecl& dtor) const { return decl_const(is_const) + "void" + decl_dtor(false, false, dtor); }
CIDecl CKBoolType::declaration(bool is_const, const CIDecl& dtor) const { return decl_const(is_const) + "_Bool" + decl_dtor(false, false, dtor); }
......
......@@ -288,6 +288,9 @@ namespace cecko {
/// Get LLVM type descriptor
virtual CKIRTypeObs get_ir() const = 0;
/// Get LLVM null value
virtual CKIRConstantObs get_null_value() const;
/// @name Determining the kind of the type
/// @{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment