[PATCH] D97462: [clang][cli] Round-trip cc1 arguments in assert builds

Alexander Richardson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 8 09:26:31 PDT 2021


arichardson added a comment.

I just merged this commit into our CHERI fork and noticed some failing tests due to round tripping:
We add some additional CodeGenOptions and LangOptions, but are not including those in the generated command line.

For example, I added an additional `std::string CHERIStatsFile;` to `CodeGenOptions`. This is set inside `bool CompilerInvocation::ParseCodeGenArgs` using `Opts.CHERIStatsFile = Args.getLastArgValue(OPT_cheri_stats_file).str();`.
I haven't added logic to round trip this flag (yet). If CC1 argument round tripping is enabled, the flag is stripped and the output goes to stderr instead of the defined file, causing some tests to fail.

Unfortunately this is not caught by any assertions, so I worry that there are other arguments that might be silently removed after this commit. Are there any open reviews/plans to check CodeGenOptions/etc, for equality after round-tripping?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97462/new/

https://reviews.llvm.org/D97462



More information about the cfe-commits mailing list