-
Notifications
You must be signed in to change notification settings - Fork 3
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
Insert Dredd declartions before first function #220
Conversation
Although this is unlikely to ever be unreasonably expensive, there is probably an optimizations that could be made. If the Clang AST is always traversed top down, then we just need to find the place that Dredd is going to modify and insert the prelude before this at the global scope. This means once |
@JamesLee-Jones Can you rebase this one please? From what I recall it should be good to go, except there was one simplification you were looking at making (see open discussion). |
295b3b0
to
bd59258
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.
One typo, and a suggestion for a small refactoring that I think will be worthwhile.
@JamesLee-Jones This will need a rebase. Does my suggested refactoring make sense and are you good to do it? |
Your suggestion makes sense, I'll refactor it today! |
6a8d335
to
4d0876d
Compare
4a895bd
to
f0261de
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! Good to go after making some very final changes.
Inserting Dredd's declarations at the beginning of the file can cause
issues with header files that have to be before any system headers. So
instead, insert Dredd's declarations at the top level before the first
mutation that we find.
Fixes: #219, #215