Skip to content

[ClangImporter] In shouldIgnoreMacro() Use Preprocessor::getSpellingOfSingleCharacterNumericConstant() for determining if a macro is '1' #27432

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

Merged
merged 1 commit into from
Sep 30, 2019

Conversation

akyrtzi
Copy link
Contributor

@akyrtzi akyrtzi commented Sep 29, 2019

tok.getLiteralData() does not work for a macro imported from a clang module (returns nullptr), while getSpellingOfSingleCharacterNumericConstant covers both kinds of macros (defined in source or imported from a module).

Unfortunately this currently only matters for an internal tool so I cannot accompany this change with a test case.

…ngOfSingleCharacterNumericConstant()` for determining if a macro is '1'

`tok.getLiteralData()` does not work for a macro imported from a clang module (returns `nullptr`), while `getSpellingOfSingleCharacterNumericConstant` covers both kinds of macros (defined in source or imported from a module).

Unfortunately this currently only matters for an internal tool so I cannot accompany this change with a test case.
@akyrtzi
Copy link
Contributor Author

akyrtzi commented Sep 29, 2019

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - a2fca13

@akyrtzi
Copy link
Contributor Author

akyrtzi commented Sep 30, 2019

@swift-ci test linux platform

@akyrtzi akyrtzi merged commit 439361e into swiftlang:master Sep 30, 2019
@akyrtzi akyrtzi deleted the check-macro-numeric-char branch September 30, 2019 18:29
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.

2 participants