forked from M-Labs/nac3
core/object: introduce object
A small abstraction to simplify implementations.
This commit is contained in:
parent
0bc98c447d
commit
1ce76bcfc9
@ -48,6 +48,7 @@ pub mod irrt;
|
||||
pub mod llvm_intrinsics;
|
||||
pub mod model;
|
||||
pub mod numpy;
|
||||
pub mod object;
|
||||
pub mod stmt;
|
||||
|
||||
#[cfg(test)]
|
||||
|
12
nac3core/src/codegen/object/any.rs
Normal file
12
nac3core/src/codegen/object/any.rs
Normal file
@ -0,0 +1,12 @@
|
||||
use inkwell::values::BasicValueEnum;
|
||||
|
||||
use crate::typecheck::typedef::Type;
|
||||
|
||||
/// A NAC3 LLVM Python object of any type.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct AnyObject<'ctx> {
|
||||
/// Typechecker type of the object.
|
||||
pub ty: Type,
|
||||
/// LLVM value of the object.
|
||||
pub value: BasicValueEnum<'ctx>,
|
||||
}
|
1
nac3core/src/codegen/object/mod.rs
Normal file
1
nac3core/src/codegen/object/mod.rs
Normal file
@ -0,0 +1 @@
|
||||
pub mod any;
|
Loading…
Reference in New Issue
Block a user