I wanted to use opt to get the control flow graph of a C code, using clang 18. It does not work, saying some issues with-opaque-pointers. Any idea?
root@2f18de92db5f:/# cat example.c
#include <stdio.h>
void foo(int n) {
if (n > 0) {
printf("Positiven");
} else {
printf("Non-positiven");
}
}
int main() {
foo(10);
foo(-5);
return 0;
}
root@2f18de92db5f:/# clang -S -emit-llvm example.c -o example.ll
root@2f18de92db5f:/# opt -dot-cfg example.ll
example.ll:12:17: warning: ptr type is only supported in -opaque-pointers mode
store i32 %0, ptr %2, align 4
^
opt: example.ll:12:17: error: expected type
store i32 %0, ptr %2, align 4