Skip to content

Calls to varargs functions are broken #933

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

Closed
dkolsen-pgi opened this issue Oct 2, 2024 · 1 comment · Fixed by #945
Closed

Calls to varargs functions are broken #933

dkolsen-pgi opened this issue Oct 2, 2024 · 1 comment · Fixed by #945
Assignees

Comments

@dkolsen-pgi
Copy link
Collaborator

Yesterday's rebase broke calls to varargs functions.

void f(int, ...);
void g() {
  f(3, 10, 11, 12);
}
$ clang++ -fclangir -c callvararg.cpp
loc("callvararg.cpp":3:3): error: 'llvm.call' op missing var_callee_type attribute for vararg call
fatal error: error in backend: The pass manager failed to lower CIR to LLVMIR dialect!
[ ... ]

This worked before the rebase. This prevents the use of printf in test programs, which makes it a little harder to test changes.

@smeenai
Copy link
Collaborator

smeenai commented Oct 2, 2024

Thanks for the catch, @lanza will take a look.

smeenai added a commit to smeenai/clangir that referenced this issue Oct 8, 2024
After 5da4310, the LLVM dialect
requires the variadic callee type to be present for variadic calls. The
op builders take care of this automatically if you pass the function
type, so change our lowering logic to do so. Add tests for this as well
as a missing test for indirect function call lowering.

Fixes llvm#913
Fixes llvm#933
@lanza lanza closed this as completed in #945 Oct 8, 2024
@lanza lanza closed this as completed in 2a11e98 Oct 8, 2024
smeenai added a commit to smeenai/clangir that referenced this issue Oct 9, 2024
After 5da4310, the LLVM dialect
requires the variadic callee type to be present for variadic calls. The
op builders take care of this automatically if you pass the function
type, so change our lowering logic to do so. Add tests for this as well
as a missing test for indirect function call lowering.

Fixes llvm#913
Fixes llvm#933
smeenai added a commit to smeenai/clangir that referenced this issue Oct 9, 2024
After 5da4310, the LLVM dialect
requires the variadic callee type to be present for variadic calls. The
op builders take care of this automatically if you pass the function
type, so change our lowering logic to do so. Add tests for this as well
as a missing test for indirect function call lowering.

Fixes llvm#913
Fixes llvm#933
smeenai added a commit to smeenai/clangir that referenced this issue Oct 9, 2024
After 5da4310, the LLVM dialect
requires the variadic callee type to be present for variadic calls. The
op builders take care of this automatically if you pass the function
type, so change our lowering logic to do so. Add tests for this as well
as a missing test for indirect function call lowering.

Fixes llvm#913
Fixes llvm#933
keryell pushed a commit to keryell/clangir that referenced this issue Oct 19, 2024
After 5da4310, the LLVM dialect
requires the variadic callee type to be present for variadic calls. The
op builders take care of this automatically if you pass the function
type, so change our lowering logic to do so. Add tests for this as well
as a missing test for indirect function call lowering.

Fixes llvm#913
Fixes llvm#933
lanza pushed a commit that referenced this issue Nov 5, 2024
After 5da4310, the LLVM dialect
requires the variadic callee type to be present for variadic calls. The
op builders take care of this automatically if you pass the function
type, so change our lowering logic to do so. Add tests for this as well
as a missing test for indirect function call lowering.

Fixes #913
Fixes #933
lanza pushed a commit that referenced this issue Mar 18, 2025
After 5da4310, the LLVM dialect
requires the variadic callee type to be present for variadic calls. The
op builders take care of this automatically if you pass the function
type, so change our lowering logic to do so. Add tests for this as well
as a missing test for indirect function call lowering.

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

Successfully merging a pull request may close this issue.

4 participants