Closed
Description
Issue Description
Encountered an error when using ClangIR through the MLIR to LLVMIR path. The direct path from CIR to LLVMIR works correctly, but the path through MLIR fails. Is there a plan in the ClangIR project to support the complete pathway from CIR through MLIR to LLVM IR for generating executable files?
Steps to Reproduce
- Using this simple code:
#include <stdio.h>
int main(){
printf("hello\n");
return 0;
}
- Using CIR direct to LLVMIR path (works correctly):
../bin/clang -fclangir -fclangir-direct-lowering hello.c -o hello
Execution result:
./hello
hello
- Using CIR through MLIR to LLVMIR path (fails):
../bin/clang -fclangir -fno-clangir-direct-lowering hello.c -o hello
Error message:
loc(fused["/usr/include/stdio.h":363:1, "/usr/include/stdio.h":363:56]): error: 'func.func' op symbol declaration cannot have public visibility
fatal error: error in backend: The pass manager failed to lower CIR to LLVMIR dialect!
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Metadata
Metadata
Assignees
Labels
No labels