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

Dmitry Venikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 22 05:04:55 PST 2017


Quolyk updated this revision to Diff 123914.

https://reviews.llvm.org/D39834

Files:
  lib/Driver/ToolChains/Clang.cpp
  test/Driver/opt-record.c


Index: test/Driver/opt-record.c
===================================================================
--- test/Driver/opt-record.c
+++ test/Driver/opt-record.c
@@ -9,6 +9,8 @@
 // RUN: %clang -### -S -fsave-optimization-record -x cuda -nocudainc -nocudalib %s 2>&1 | FileCheck %s -check-prefix=CHECK-NO-O -check-prefix=CHECK-CUDA-DEV
 // RUN: %clang -### -fsave-optimization-record -x cuda -nocudainc -nocudalib %s 2>&1 | FileCheck %s -check-prefix=CHECK-NO-O -check-prefix=CHECK-CUDA-DEV
 // RUN: %clang -### -S -o FOO -fsave-optimization-record -foptimization-record-file=BAR.txt %s 2>&1 | FileCheck %s -check-prefix=CHECK-EQ
+// RUN: %clang -### -S -o FOO -foptimization-record-file=BAR.txt %s 2>&1 | FileCheck %s -check-prefix=CHECK-EQ
+// RUN: %clang -### -S -o FOO -foptimization-record-file=BAR.txt -fno-save-optimization-record %s 2>&1 | FileCheck %s --check-prefix=CHECK-FOPT-DISABLE
 
 // CHECK: "-cc1"
 // CHECK: "-opt-record-file" "FOO.opt.yaml"
@@ -20,3 +22,4 @@
 // CHECK-EQ: "-cc1"
 // CHECK-EQ: "-opt-record-file" "BAR.txt"
 
+// CHECK-FOPT-DISABLE-NOT: "-fno-save-optimization-record"
Index: lib/Driver/ToolChains/Clang.cpp
===================================================================
--- lib/Driver/ToolChains/Clang.cpp
+++ lib/Driver/ToolChains/Clang.cpp
@@ -4342,6 +4342,7 @@
     CmdArgs.push_back("-fapple-pragma-pack");
 
   if (Args.hasFlag(options::OPT_fsave_optimization_record,
+                   options::OPT_foptimization_record_file_EQ,
                    options::OPT_fno_save_optimization_record, false)) {
     CmdArgs.push_back("-opt-record-file");
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39834.123914.patch
Type: text/x-patch
Size: 1592 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171122/16099582/attachment-0001.bin>


More information about the cfe-commits mailing list