Skip to content

[flang] Adding ability to customize the printer of the LLVMIRLoweringPass #690

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

Merged
merged 1 commit into from
Mar 19, 2021

Conversation

Renaud-K
Copy link
Collaborator

I would like to have the ability to customize the printer in the LLVMIRLoweringPass in order to just print the global variable initializations in the flange flow.

Currently, the pass does 2 things, it lowers and prints with a hardcoded llvmModule->print(output, nullptr)
I started with my own copy of LLVMIRLoweringPass and just changed the part that does the printing to meet my needs but maybe we can avoid the cut-and-paste.

To that end, I am adding an extra argument to the creation of the pass which is an optional printer. If none is provided a default is created to do what it currently does (llvmModule->print(output, nullptr)). This way the client code does need to change.

@Renaud-K Renaud-K changed the title Adding ability to customize the printer of the LLVMIRLoweringPass [flang] Adding ability to customize the printer of the LLVMIRLoweringPass Mar 18, 2021
@Renaud-K Renaud-K requested a review from tskeith March 18, 2021 22:02
@Renaud-K Renaud-K merged commit da2db58 into fir-dev Mar 19, 2021
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.

2 participants