We should re-emit #pragma once to ensure the preprocessor will still honor when running on minimized sources.
Details
Details
- Reviewers
Bigcheese dexonsmith - Commits
- rG4cd905bdc1a8: [clang-scan-deps] Dependency directives source minimizer: handle #pragma once
rC366509: [clang-scan-deps] Dependency directives source minimizer: handle #pragma once
rL366509: [clang-scan-deps] Dependency directives source minimizer: handle #pragma once
Diff Detail
Diff Detail
- Repository
- rC Clang
Event Timeline
Comment Actions
LGTM after you add the testcase I mention.
clang/lib/Lex/DependencyDirectivesSourceMinimizer.cpp | ||
---|---|---|
623 | I wondered if it was wrong to ignore extra token on the line, but clang does as well (and emits -Wextra-tokens) so this is fine. | |
clang/unittests/Lex/DependencyDirectivesSourceMinimizerTest.cpp | ||
551–555 | Can you also add a test with #pragma once extra tokens? It should get canonicalized to #pragma once. |
I wondered if it was wrong to ignore extra token on the line, but clang does as well (and emits -Wextra-tokens) so this is fine.