numba / numba/llvmlite

Publicly expose (document) the type attribute of Constants

Open
#490 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.3k
Forks
373
Avg merge
3d 2h
Merged PRs (30d)
10

Description

`ir.Constant` objects are constructed with an `ir.Type` argument, which is stored in the undocumented `self.type` attribute. That attribute is helpful for using `ir.Constant`s in places where an explicit type is needed, such as `alloca`:

```python
constant = get_some_constant()
slot = builder.alloca(constant.type)
builder.store(constant, slot)
```

But I don't feel good about using it unless it's clearly documented as part of the public API.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the public API documentation or source entry point for ir.Constant and inspect how its constructor and attributes are presented. Document the existing type attribute as public, including its use with alloca, and consider the issue complete when users can find that documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.