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

Add CIRGen and LowerToLLVM support for remaining pointer arithmetic extensions for C #579

Open
bcardosolopes opened this issue May 3, 2024 · 2 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@bcardosolopes
Copy link
Member

From clang/test/CIR/CodeGen/pointer-arith-ext.c:

...

// FIXME: add support for the remaining ones.
// FP f5(FP a, int b) { return a + b; }
// FP f5_1(FP a, int b) { return (a += b); }
// FP f6(int a, FP b) { return a + b; }
// FP f6_1(int a, FP b) { return (a += b); }
// FP f7(FP a, int b) { return a - b; }
// FP f7_1(FP a, int b) { return (a -= b); }
// void f8(void *a, int b) { return *(a + b); }
// void f8_1(void *a, int b) { return a[b]; }

These are really good first issues to tackle.

@bcardosolopes bcardosolopes added the good first issue Good for newcomers label May 3, 2024
@PragmaTwice
Copy link
Contributor

PragmaTwice commented May 6, 2024

Hello, I am new to Clang IR and would like to work on this task. Could you assign it to me if it is still available? Thank you!

@bcardosolopes
Copy link
Member Author

Hi, welcome. These indeed are good ones. Assigned!

bcardosolopes pushed a commit that referenced this issue May 18, 2024
In this PR, we support for dereferencing void pointers as a GNU C
extension. This include two modification:
- In CIRGen, we support to build ReturnStmt with void return type.
- In LowerToLLVM, we support to lower CIR load with void result type to
LLVM.

It's a part of #579, since I would
like to split it to two tasks:
- support pointer arithmetic for function types (#594)
- **support to dereference void pointer (this PR)**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants