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

Complex #if expressions in C files having loops #41

Open
sonnguyenvnu opened this issue Dec 24, 2017 · 1 comment
Open

Complex #if expressions in C files having loops #41

sonnguyenvnu opened this issue Dec 24, 2017 · 1 comment
Assignees

Comments

@sonnguyenvnu
Copy link

sonnguyenvnu commented Dec 24, 2017

Hello,

I have used TypeChef to generate call graphs of C program files containing Ifdef (option --dumpcfg). In cases of C files having loops (like the attached C file), the #if expressions might be very complex. One of these complex expressions generated by TypeChef in the attached file (there are some longer expressions, you can see the C file's generated cfg):

#if (definedEx(CONFIG_PPC_64K_PAGES) && definedEx(CONFIG_LOCKDEP) && (!definedEx(CONFIG_PPC_16K_PAGES) || definedEx(CONFIG_PPC_256K_PAGES) || definedEx(CONFIG_PPC_64K_PAGES)) && !definedEx(CONFIG_PPC_256K_PAGES) && (definedEx(CONFIG_PPC_16K_PAGES) || definedEx(CONFIG_PPC_256K_PAGES) || definedEx(CONFIG_PPC_64K_PAGES)) && (!definedEx(CONFIG_LOCKDEP) || !definedEx(CONFIG_PPC_256K_PAGES)))

I think it is possible to simplify these expressions, and you might consider this feature.

Thanks,
Son
complex_if_expressions.zip

@joliebig
Copy link
Collaborator

Hi,
there is support for simplifying presence conditions (see link).

Apart from that, there is an evaluation on presence-condition simplification from von Rhein et al. (see link).

Maybe this helps.
jl

@joliebig joliebig self-assigned this Dec 26, 2017
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