-
Notifications
You must be signed in to change notification settings - Fork 55
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
Preprocessor: Add debug dump options #745
Conversation
Adds support for GCC's -dD, -dM, -dN flags which enable dumping macro names and/or definitions along with or instead of preprocessor output.
src/aro/Driver.zig
Outdated
m: bool = false, | ||
n: bool = false, | ||
|
||
/// Specifying letters whose behavior conflicts is undefined. |
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.
This could specify that we match clang's behavior.
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.
Does it actually match clang as it is now? I just chose the current order because it was alphabetical.
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.
Ok just did a quick check - clang doesn't support -dN
; and -dM
wins over -dD
(it always does -dM
regardless of order if -dD
and -dM
are provided). I'll update it to match that.
@Vexu Once this is merged, would you be able to sync aro to the main zig repo? I'd like to try updating https://github.com/ziglang/zig/blob/master/tools/generate_linux_syscalls.zig to use aro instead of Is there a technical reason why Zig can't use aro as a |
Sure!
I don't think so as long as bootstrapping doesn't depend on it. I'd ask @andrewrk before trying to get that to work since he tends to have opinions on stuff like that. |
On second thought - let me see if I can make some progress on #732 before the sync. |
Adds support for GCC's -dD, -dM, -dN flags which enable dumping macro names and/or definitions along with or instead of preprocessor output.
Added a
CHECK_PARTIAL_MATCH
option for preprocessor testing, because the output contains things like__TIME__
which is difficult to fit into our existing preprocessor test framework.-dM
is also difficult to test extensively with the existing framework because it dumps the output in arbitrary order (just iterates overpp.defines
) which seems to match the observed behavior of clang