Skip to content
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

[analyzer] Add flags to log_parser.py #3433

Merged
merged 1 commit into from
Sep 21, 2021

Conversation

waqas-mazhar
Copy link
Contributor

@waqas-mazhar waqas-mazhar commented Sep 15, 2021

Add -mfp16-format, -fmacro-prefix-map and -fno-defer-pop
to IGNORED_OPTIONS_GCC as they are not recognized by clang.

@csordasmarton csordasmarton added the analyzer 📈 Related to the analyze commands (analysis driver) label Sep 15, 2021
@csordasmarton csordasmarton added this to the release 6.17.1 milestone Sep 15, 2021
'-fgcse-lm',
'-fhoist-adjacent-loads',
'-findirect-inlining',
'-finline-limit',
'-finline-local-initialisers',
'-fipa-sra',
'-fmacro-prefix-map',
Copy link
Contributor

Choose a reason for hiding this comment

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

From clang 10.0.0 this flag is already supported: https://reviews.llvm.org/D49466. So maybe it is not a good idea to skip this flag in CodeChecker but to update your clang version in this case. What do you think @bruntib?

Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately, currently it is an "unwritten rule" that we support all versions of the analyzers. This is the concept of our checker labels too: we list all checkers ever existed in clang even with their old names if they were renamed. We have been following the same rule with this log parser: we skip flags if any clang version doesn't support them, but we have never removed any of these from the list just because Clang started to support it.
I agree that this is not a good approach. But I think this will not be solved nowadays. We were planning to create a 3pp tool that handles these compiler flags so that tool can also be used in other projects like CodeCompass. @gamesh411 started its development. I think this logic with different clang versions could be implemented in this tool if we get there in the future. As part of that project we could also review if any of these skipped flags are still unsupported by the latest clang.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am keeping this flag in the changeset unless unanimously advised otherwise.

'-fno-extended-identifiers',
'-fno-jump-table',
'-fno-keep-static-consts',
'-fno-reorder-functions',
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: on the Phabricator there is a patch for clang to support this flag but as far as I see it is not merged yet and still under review: https://reviews.llvm.org/D34796.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your response @csordasmarton. I have removed this flag altogether because it is already covered by the flag in the next line -f(no-)?reorder-functions

@@ -220,7 +223,7 @@
'-[DIUF]',
'-idirafter',
'-isystem',
'-macros',
'-imacros',
Copy link
Contributor

Choose a reason for hiding this comment

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

This flag is fixed by #3428 and it is merged. It is very interesting that github doesn't recognise this as a merge conflict but shows this as a change. Can you please rebase your branch to hide this change from this commit? Otherwise this patch looks good to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rebased and commit message corrected.

Add -mfp16-format, -fmacro-prefix-map and -fno-defer-pop
to IGNORED_OPTIONS_GCC as they are not recognized by clang.
Copy link
Contributor

@csordasmarton csordasmarton left a comment

Choose a reason for hiding this comment

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

LGTM!

@csordasmarton csordasmarton merged commit c2bdafd into Ericsson:master Sep 21, 2021
@csordasmarton csordasmarton modified the milestones: release 6.17.1, release 6.18.0 Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer 📈 Related to the analyze commands (analysis driver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants