Skip to content
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

How can I access the pointer of a constant GEP #410

Open
were opened this issue Apr 18, 2023 · 3 comments
Open

How can I access the pointer of a constant GEP #410

were opened this issue Apr 18, 2023 · 3 comments
Labels

Comments

@were
Copy link

were commented Apr 18, 2023

Describe the Bug

Say I have a global string in LLVM

@0 = constant [2 x i8] "\n\0", align 1

And then I do a load to this @0.

i8* getelementptr inbounds ([2xi8], [2xi8]* @0, i32 0, i32 0)

Then in Inkwell it will first be a PointerValue.
A PointerValue has no operand to access, so I cannot get the @0 for my analysis.

Maybe this is not a bug, but a feature request. Did we expose ConstExpr data structures in Inkwell?

@TheDan64
Copy link
Owner

I don't think the C api has access to ConstExpr

@TheDan64
Copy link
Owner

I think PointerValue is right since GEP always returns a ptr? i8* getelementptr

@TheDan64
Copy link
Owner

So you probably wanna do a load

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants