paulgazz / kmax

A collection of analysis tools for Kconfig and Kbuild constraints.
42 stars 21 forks source link

Add IS_ENABLED macro support to call to SuperC from Klocalizer.get_sourceline_pc_linux_file() #113

Closed necipfazil closed 3 years ago

necipfazil commented 3 years ago

While computing the sourceline presence conditions for a Linux source file using SuperC (Klocalizer.get_sourceline_pc_linux_file()), add the necessary support to let SuperC handle IS_ENABLED macros.

SuperC cannot directly handle IS_ENABLED macros in linux source.

To solve this issue, a header need to be included, which includes the following code for each config option there is:

#ifdef CONFIG_OPTION
#define CONFIG_OPTION 1
#else
#undef CONFIG_OPTION
#endif

These changes implement creating and including such header file while running SuperC from Klocalizer.get_sourceline_pc_linux_file().

necipfazil commented 3 years ago

@Uclydde these changes will let plocalizer handle IS_ENABLED macros.