[PATCH] D96847: [clang][cli] Store additional optimization remarks info
Jan Svoboda via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 17 01:08:10 PST 2021
jansvoboda11 created this revision.
jansvoboda11 added reviewers: Bigcheese, dexonsmith.
jansvoboda11 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
After a revision of D96274 <https://reviews.llvm.org/D96274> changed `DiagnosticOptions` to not store all remark arguments **as-written**, it is no longer possible to reconstruct the arguments accurately from the class.
This is caused by the fact that for `-Rpass=regexp` and friends, `DiagnosticOptions` store only the group name `pass` and not `regexp`. This is the same representation used for the plain `-Rpass` argument.
Each argument must be generated exactly once in `CompilerInvocation::generateCC1CommandLine`, otherwise each subsequent call would produce more arguments than the previous one. This currently works out because of the way `RoundTrip` splits the responsibilities for certain arguments based on what arguments were queried during parsing. This breaks when we move to single round-trip for the whole `CompilerInvocation`.
This patch ensures that for one `-Rpass=regexp`, we don't generate two arguments (`-Rpass` from `DiagnosticOptions` and `-Rpass=regexp` from `CodeGenOptions`) by shifting the responsibility for handling both cases to `CodeGenOptions`. To distinguish between the cases correctly, additional information is stored in `CodeGenOptions`.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D96847
Files:
clang/include/clang/Basic/CodeGenOptions.h
clang/lib/Frontend/CompilerInvocation.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96847.324223.patch
Type: text/x-patch
Size: 9507 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210217/24e05023/attachment.bin>
More information about the cfe-commits
mailing list