r363463 - [Remarks][NFC] Improve testing and documentation of -foptimization-record-passes

Francis Visoiu Mistrih via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 14 14:38:57 PDT 2019


Author: thegameg
Date: Fri Jun 14 14:38:57 2019
New Revision: 363463

URL: http://llvm.org/viewvc/llvm-project?rev=363463&view=rev
Log:
[Remarks][NFC] Improve testing and documentation of -foptimization-record-passes

This adds:

* documentation to the user manual
* nicer error message
* test for the error case
* test for the gold plugin

Modified:
    cfe/trunk/docs/UsersManual.rst
    cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
    cfe/trunk/test/CodeGen/opt-record.c

Modified: cfe/trunk/docs/UsersManual.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/UsersManual.rst?rev=363463&r1=363462&r2=363463&view=diff
==============================================================================
--- cfe/trunk/docs/UsersManual.rst (original)
+++ cfe/trunk/docs/UsersManual.rst Fri Jun 14 14:38:57 2019
@@ -345,6 +345,18 @@ output format of the diagnostics that it
    after the primary file being compiled. If that's "foo.c", for example,
    optimization records are output to "foo.opt.yaml".
 
+.. _opt_foptimization-record-passes:
+
+**-foptimization-record-passes**
+   Only include passes which match a specified regular expression.
+
+   When optimization reports are being output (see
+   :ref:`-fsave-optimization-record <opt_fsave-optimization-record>`), this
+   option controls the passes that will be included in the final report.
+
+   If this option is not used, all the passes are included in the optimization
+   record.
+
 .. _opt_fdiagnostics-show-hotness:
 
 **-f[no-]diagnostics-show-hotness**

Modified: cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td?rev=363463&r1=363462&r2=363463&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td Fri Jun 14 14:38:57 2019
@@ -229,7 +229,7 @@ def err_drv_gnustep_objc_runtime_incompa
 def err_drv_emit_llvm_link : Error<
    "-emit-llvm cannot be used when linking">;
 def err_drv_optimization_remark_pattern : Error<
-  "%0 in '%1'">;
+  "in pattern '%1': %0">;
 def err_drv_no_neon_modifier : Error<"[no]neon is not accepted as modifier, please use [no]simd instead">;
 def err_drv_invalid_omp_target : Error<"OpenMP target is invalid: '%0'">;
 def err_drv_omp_host_ir_file_not_found : Error<

Modified: cfe/trunk/test/CodeGen/opt-record.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/opt-record.c?rev=363463&r1=363462&r2=363463&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/opt-record.c (original)
+++ cfe/trunk/test/CodeGen/opt-record.c Fri Jun 14 14:38:57 2019
@@ -5,6 +5,7 @@
 // RUN: cat %t.yaml | FileCheck -check-prefix=CHECK -check-prefix=CHECK-PGO %s
 // RUN: %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o %t -dwarf-column-info -opt-record-file %t.yaml -opt-record-passes inline -emit-obj
 // RUN: cat %t.yaml | FileCheck -check-prefix=CHECK-PASSES %s
+// RUN: not %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o %t -dwarf-column-info -opt-record-file %t.yaml -opt-record-passes "(foo" -emit-obj 2>&1 | FileCheck -check-prefix=CHECK-PATTERN-ERROR %s
 // REQUIRES: x86-registered-target
 
 void bar();
@@ -34,3 +35,5 @@ void Test(int *res, int *c, int *d, int
 // CHECK: Function:        Test
 // CHECK-PGO: Hotness:
 // CHECK-PASSES-NOT: loop-vectorize
+
+// CHECK-PATTERN-ERROR: error: in pattern '(foo': parentheses not balanced




More information about the cfe-commits mailing list