Greetings,
I’m from the UTFPR university in Brazil. We are currently working on adding a new pragma for approximated computation. At the moment, we have implemented a custom skeleton based on this repository: clang-custom-pragma.
However, I’m encountering a problem specifically when I reach the ‘funct’ pragma in the code. Here’s an example snippet:
#include <stdio.h>
void foo(int arg) {
printf("Testing: %d\n", arg);
}
int main() {
#pragma clang utfpr main 20
printf("%d\n", 10);
#pragma clang utfpr funct foo 15
foo(20);
return 0;
}
When I attempt to generate the IR using the command “clang -S -emit-llvm,” I receive the following error message:
testing2.c:10:16: error: 'utfpr' attribute requires exactly 3 arguments
#pragma clang utfpr funct foo 15
^
1 error generated.
I’m unsure why this error is occurring, as I have successfully added the “#pragma clang main” directive. Could you please guide me on where I can modify the number of arguments required for the pragma?
Thank you, Victor Briganti
Here is the link to the code on the UTFPR branch of the llvm-project repository.