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

Unable to import multiple analysis in same TU #80

Closed
HerbertJordan opened this issue Apr 20, 2016 · 3 comments
Closed

Unable to import multiple analysis in same TU #80

HerbertJordan opened this issue Apr 20, 2016 · 3 comments

Comments

@HerbertJordan
Copy link
Collaborator

Due to the utilization of global management structures, including the

ProgramFactory *ProgramFactory::base __attribute__ ((weak)) = nullptr;

and

static factory_Sf_varpointsto_example factory;

it is not possible to import more than one analysis into a single C++ translation unit. We should try to get rid of those.

@b-scholz
Copy link
Member

We needed these factories for finding any arbitrary analysis at runtime.
Could you preserve the functionality?

@HerbertJordan
Copy link
Collaborator Author

The call

ProgramFactory::find("my_analysis");

should still work -- and is also tested by the interface integration tests, as far as I know.

The Mechanism works as follows: The constructor of a factory is registering it within the list of factories maintained by the common base class ProgramFactory. This registering is triggered by the creation of a global factory variable of the proper type. I altered the code so that the global variable name contains now the name of the analysis, e.g. factory_points_to_analysis.

@b-scholz
Copy link
Member

Great! We just need to be conscientious so that the Oracle Labs folk still can use a newer version of Souffle.

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