This is an archive of the discontinued LLVM Phabricator instance.

[clang-scan-deps] Dependency directives source minimizer: handle #pragma once
ClosedPublic

Authored by arphaman on Jul 18 2019, 1:26 PM.

Diff Detail

Repository
rC Clang

Event Timeline

arphaman created this revision.Jul 18 2019, 1:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2019, 1:27 PM
dexonsmith accepted this revision.Jul 18 2019, 1:45 PM

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.

This revision is now accepted and ready to land.Jul 18 2019, 1:45 PM
This revision was automatically updated to reflect the committed changes.
arphaman marked 2 inline comments as done.
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2019, 3:32 PM