[PATCH] D39834: [ClangDriver] -foptimization-record-file= should imply -fsave-optimization-record

Dmitry Venikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 9 02:10:26 PST 2017

Quolyk created this revision.
Herald added a subscriber: ilya-biryukov.

This is my first attempt to contribute to llvm. I'm trying to implement this https://bugs.llvm.org/show_bug.cgi?id=33670. I'm struggling with writing tests for this patch. I will be very thankful if somebody guides me trough writing tests for such thing. Thanks a lot.



Index: lib/Driver/ToolChains/Clang.cpp
--- lib/Driver/ToolChains/Clang.cpp
+++ lib/Driver/ToolChains/Clang.cpp
@@ -4376,6 +4376,11 @@
       llvm::sys::path::replace_extension(F, "opt.yaml");
+  } else {
+    if (const Arg *A = Args.getLastArg(options::OPT_foptimization_record_file_EQ)) {
+      CmdArgs.push_back("-opt-record-file");
+      CmdArgs.push_back(A->getValue());
+    }
   bool RewriteImports = Args.hasFlag(options::OPT_frewrite_imports,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39834.122209.patch
Type: text/x-patch
Size: 584 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171109/a126941e/attachment.bin>

More information about the cfe-commits mailing list