Skip to content

[mypyc] Introduce GetElementPtr #9260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 4, 2020
Merged

[mypyc] Introduce GetElementPtr #9260

merged 4 commits into from
Aug 4, 2020

Conversation

TH3CHARLie
Copy link
Collaborator

relates mypyc/mypyc#741

This PR introduces GetElementPtr, which computes the address of an element in an aggregate type.

Part of efforts to support the len and other macro-related primitives.

@TH3CHARLie TH3CHARLie requested a review from JukkaL August 4, 2020 08:30
Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments, mostly about making this a bit more user friendly.

@TH3CHARLie TH3CHARLie requested a review from JukkaL August 4, 2020 12:17
Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates!


def __init__(self, src: Value, src_type: RType, field: str, line: int = -1) -> None:
super().__init__(line)
self.type = c_pyssize_t_rprimitive
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Later on, this can be switched to a dedicated pointer rtype (which is still treated as an integer).

@JukkaL JukkaL merged commit ffd9d1c into python:master Aug 4, 2020
@TH3CHARLie TH3CHARLie deleted the impl-GEP branch August 4, 2020 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy