-
Notifications
You must be signed in to change notification settings - Fork 447
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
Clean up the includes in the IR folder #3701
Conversation
2b79f7b
to
aa94aac
Compare
6c292da
to
aa64e11
Compare
d8674e1
to
befecb4
Compare
testdata/p4_16_samples_outputs/parser-inline/parser-inline-test1-frontend.p4
Outdated
Show resolved
Hide resolved
You should not mix reformatting with this PR, because it makes it very difficult to review. |
9632054
to
c9fb82e
Compare
c9fb82e
to
cb80f4d
Compare
cb80f4d
to
b6cc54f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, I agree it's better in long-run to maintain proper includes instead of having one "super-header". It's surprising that the amount of includes this PR needs to add is relatively low - headers are likely pulled in anyway - on the other hand it's great backends won't need many changes after this PR.
frontends/p4/optimizeExpressions.h
Outdated
#include "frontends/common/constantFolding.h" | ||
#include "frontends/p4/strengthReduction.h" | ||
|
||
namespace IR { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Headers in frontends/p4 usually put names into namespace P4
, should we do the same here?
Yeah, most of the back ends and the mid end just use IR nodes and visitors. The generated IR file also still pulls in a lot of includes. I think this can also be improved, but at least the file is self-contained now. |
Major rework of how the ir libraries are structured. This removes most of the includes from the
ir.h
file and distributes them across the compiler. There are two reasons why this is done.ir.h
was included, basically all library headers and ir headers were included. This likely causes an increase in compile time.Now with these changes it should be much easier to make changes to the ir classes and files, including simplifying includes and dependencies.
This PR should definitely be tested on downstream extensions since it touches a core part of the compiler.