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

Params referenced by Varrefs have an undefined bitWidth value #97

Open
tiagolascasas opened this issue Jul 20, 2022 · 0 comments
Open
Assignees
Labels

Comments

@tiagolascasas
Copy link
Member

tiagolascasas commented Jul 20, 2022

If a varref references a param declaration, neither of the nodes have a defined bitWidth value. This does not happen if the varref references other types of declarations. Replicate with the aspect:

import weaver.WeaverJps;
aspectdef Test
	for (var v of Query.search("varref")) {
		println("varref: " + v.code + " - " + v.bitWidth +
		" | decl: " + v.decl.code + " - " + v.decl.bitWidth);
	}
end

And with the input source code:

void foo(int A[100], int B) {
	for (int i = 0; i < 100; i++) {
		A[i] = A[i] + B;
	}
}

The output is:

varref: i - 32        | decl: int i = 0 - 32
varref: i - 32        | decl: int i = 0 - 32
varref: A - undefined | decl: int A[100] - undefined
varref: i - 32        | decl: int i = 0 - 32
varref: A - undefined | decl: int A[100] - undefined
varref: i - 32        | decl: int i = 0 - 32
varref: B - 32        | decl: int B - 32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants