Skip to content

Conversation

@psigen
Copy link
Member

@psigen psigen commented Apr 12, 2020

This PR eliminates the need for the singleton instantiation of the chimera::Configuration by implementing custom factory classes that allow the configuration to be passed to the ASTConsumer directly.

This PR eliminates the need for the singleton instantiation of the
chimera::Configuration by implementing custom factory classes that
allow the configuration to be passed to the ASTConsumer directly.
if(BUILD_TESTING)
enable_testing()
add_subdirectory(test EXCLUDE_FROM_ALL)
endif()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that there was a BUILD_TESTING flag being used, but it didn't seem to affect the build. I needed to build without tests (I didn't have python 3.7 installed), so I added this option.

Feel free to suggest a different name for the flag.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BUILD_TESTING is automatically set when we include CTest. I think the issue is that CTest is being included in test/examples/CMakeLists.txt (line: 1). Let's replace line 174 with include(CTest) and remove line 1 of test/examples/CMakeLists.txt.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this look like what you had in mind?

*/
std::unique_ptr<clang::tooling::FrontendActionFactory> newFrontendActionFactory(
const chimera::Configuration &config);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach is summarized in this comment thread requesting this functionality be added to LLVM. It doesn't look like it was added though :(

http://lists.llvm.org/pipermail/cfe-dev/2014-December/040607.html

@psigen psigen requested a review from jslee02 April 12, 2020 02:29
Copy link
Member

@jslee02 jslee02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few suggestions

if(BUILD_TESTING)
enable_testing()
add_subdirectory(test EXCLUDE_FROM_ALL)
endif()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BUILD_TESTING is automatically set when we include CTest. I think the issue is that CTest is being included in test/examples/CMakeLists.txt (line: 1). Let's replace line 174 with include(CTest) and remove line 1 of test/examples/CMakeLists.txt.

@psigen
Copy link
Member Author

psigen commented Apr 12, 2020

Thanks @jslee02, made the suggested changes in 0ddac1b

@jslee02 jslee02 added this to the Chimera 0.2.0 milestone Apr 12, 2020
@psigen
Copy link
Member Author

psigen commented Apr 12, 2020

Ok, I think I made all the changes now.

Copy link
Member

@jslee02 jslee02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@psigen psigen merged commit 33feef7 into master Apr 12, 2020
@psigen psigen deleted the no_singleton_config branch April 12, 2020 18:37
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

Successfully merging this pull request may close these issues.

3 participants