Skip to content

Commit

Permalink
update environment.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermeleobas authored and pearu committed Aug 22, 2021
1 parent 8b60282 commit 95911c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .conda/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

name: rbc
channels:
- numba
- conda-forge
- numba
- defaults
dependencies:
- python>=3.7
Expand Down
10 changes: 2 additions & 8 deletions rbc/structure_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
__all__ = ['StructureNumbaType', 'StructureNumbaPointerType', 'make_numba_struct']

import operator
from rbc.irutils import get_member_value
from llvmlite import ir
from numba.core import datamodel, extending, types, imputils, typing, cgutils, typeconv

Expand Down Expand Up @@ -131,14 +132,7 @@ def model__init__(self, dmm, fe_type):
def StructureNumbaType_getattr_impl(context, builder, sig, struct, attr):
model = datamodel.default_manager.lookup(sig)
index = model.get_field_position(attr)

if struct.opname == 'load':
ptr = builder.gep(struct.operands[0], [int32_t(0), int32_t(0)])
return builder.load(builder.gep(ptr, [int32_t(index)]))
elif struct.opname == 'insertvalue':
return builder.extract_value(struct, [index])
else:
raise ValueError(struct.opname)
return get_member_value(builder, struct, index)


@lowering_registry.lower_setattr_generic(StructureNumbaType)
Expand Down

0 comments on commit 95911c5

Please sign in to comment.