Skip to content

[clang][ScanDeps] Canonicalize -D and -U flags #8251

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

Conversation

Bigcheese
Copy link

Canonicalize -D and -U flags by sorting them and only keeping the last instance of a given name.

This optimization will only fire if all -D and -U flags start with a simple identifier that we can guarantee a simple analysis of can determine if two flags refer to the same identifier or not. See the comment on getSimpleMacroName() for details of what the issues are.

Cherry pick of: llvm#82568

@Bigcheese
Copy link
Author

@swift-ci test

@Bigcheese Bigcheese force-pushed the dev/canonicalize-macros-stable-20230725 branch from 935ec22 to 9a0c91f Compare February 23, 2024 00:50
@Bigcheese
Copy link
Author

@swift-ci test

Previous version had test issues on Windows, should be fixed now.

@Bigcheese
Copy link
Author

@swift-ci test

1 similar comment
@Bigcheese
Copy link
Author

@swift-ci test

@Bigcheese
Copy link
Author

@swift-ci test llvm

@Bigcheese
Copy link
Author

@swift-ci test linux platform

@Bigcheese Bigcheese force-pushed the dev/canonicalize-macros-stable-20230725 branch from 9a0c91f to 9474cf8 Compare February 23, 2024 04:24
@Bigcheese
Copy link
Author

Tests all failed because of unrelated issues. Rebased and trying again.

@Bigcheese
Copy link
Author

@swift-ci test

@Bigcheese
Copy link
Author

@swift-ci test llvm

@Bigcheese
Copy link
Author

@swift-ci test windows platform

Canonicalize `-D` and `-U` flags by sorting them and only keeping the
last instance of a given name.

This optimization will only fire if all `-D` and `-U` flags start with
a simple identifier that we can guarantee a simple analysis of can
determine if two flags refer to the same identifier or not. See the
comment on `getSimpleMacroName()` for details of what the issues are.

Cherry pick of: llvm#82568
@Bigcheese Bigcheese force-pushed the dev/canonicalize-macros-stable-20230725 branch from 9474cf8 to 70bda48 Compare February 23, 2024 22:28
@Bigcheese
Copy link
Author

@swift-ci test

@Bigcheese
Copy link
Author

@swift-ci test llvm

@Bigcheese
Copy link
Author

@swift-ci test windows platform

1 similar comment
@Bigcheese
Copy link
Author

@swift-ci test windows platform

@Bigcheese
Copy link
Author

LLVM Linux test failures are unrelated and already existing.

@Bigcheese
Copy link
Author

I'm told the failing Windows test is flakey, retesting.

@Bigcheese
Copy link
Author

@swift-ci test windows platform

1 similar comment
@artemcm
Copy link

artemcm commented Feb 26, 2024

@swift-ci test windows platform

@artemcm
Copy link

artemcm commented Feb 26, 2024

swiftlang/swift#71886
@swift-ci test windows platform

@Bigcheese Bigcheese merged commit 8dea05d into swiftlang:stable/20230725 Feb 28, 2024
@Bigcheese Bigcheese deleted the dev/canonicalize-macros-stable-20230725 branch March 5, 2024 22:45
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.

3 participants