[PATCH] D64945: [clang-scan-deps] Dependency directives source minimizer: handle #pragma once
Duncan P. N. Exon Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 18 13:46:53 PDT 2019
dexonsmith accepted this revision.
dexonsmith added a comment.
This revision is now accepted and ready to land.
LGTM after you add the testcase I mention.
Comment at: clang/lib/Lex/DependencyDirectivesSourceMinimizer.cpp:623
+ // #pragma once
+ skipLine(First, End);
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.
Comment at: clang/unittests/Lex/DependencyDirectivesSourceMinimizerTest.cpp:551-555
+ StringRef Source = R"(// comment
+// another comment
Can you also add a test with `#pragma once extra tokens`? It should get canonicalized to `#pragma once`.
CHANGES SINCE LAST ACTION
More information about the cfe-commits