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

Cranelift: The clif-util run command seems can not find the entry function #9655

Closed
abc767234318 opened this issue Nov 22, 2024 · 4 comments
Closed

Comments

@abc767234318
Copy link

I constructed a clif file.

multi_func21_fail_to_find_function.zip

I used the following command to run it.

clif-util run -v file_tests/multi_func21.clif

But I got the following error:

file_tests/multi_func21_fail_to_find_function.clif: 1: expected a function name, e.g. %my_fn
1 file
Error: 1 failure

On line 872 I specify the name of the function to run: And the definition of u1:0 is on line 764.

; print: u1:0()
@abc767234318 abc767234318 changed the title Cranelift: The clif-util run command does not seem to find the entry function Cranelift: The clif-util run command seems can not find the entry function Nov 22, 2024
@bjorn3
Copy link
Contributor

bjorn3 commented Nov 22, 2024

I think you need to use a function name like %my_func instead of a function name like u1:0.

@abc767234318
Copy link
Author

I think you need to use a function name like %my_func instead of a function name like u1:0.

The names of these functions are randomly generated, and they are named using numbers to facilitate subsequent analysis. In addition, other clif files I generated were named in a similar way and did not encounter this error.

@bjorn3
Copy link
Contributor

bjorn3 commented Nov 22, 2024

At

if let Some(Token::Name(name)) = self.token() {
the code for parsing ; print directives expects a Token::Name for the name of the function. %my_func is tokenized as Token::Name. u1:0 is not tokenized as Token::Name however. Only tokens that start with %.

@abc767234318
Copy link
Author

At

if let Some(Token::Name(name)) = self.token() {

the code for parsing ; print directives expects a Token::Name for the name of the function. %my_func is tokenized as Token::Name. u1:0 is not tokenized as Token::Name however. Only tokens that start with %.

Thank you very much, I will close this issue.

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

No branches or pull requests

2 participants