]> granicus.if.org Git - clang/commitdiff
Add flag -fauto-profile as alias to -fprofile-sample-use.
authorDiego Novillo <dnovillo@google.com>
Fri, 6 Dec 2013 17:58:19 +0000 (17:58 +0000)
committerDiego Novillo <dnovillo@google.com>
Fri, 6 Dec 2013 17:58:19 +0000 (17:58 +0000)
Summary:
GCC uses -fauto-profile to enable sample-based PGO. This patch
adds it to Clang as an alias for -fprofile-sample-use.

Differential Revision: http://llvm-reviews.chandlerc.com/D2353

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196589 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Options.td
test/Driver/clang_f_opts.c

index 9e7dc78d63cfdc12193526ce0db5d60e94e326d2..f80069591a3d13169ed79bf5809ba3cc83beb611 100644 (file)
@@ -369,6 +369,8 @@ def fno_autolink : Flag <["-"], "fno-autolink">, Group<f_Group>,
 def fprofile_sample_use_EQ : Joined<["-"], "fprofile-sample-use=">,
     Group<f_Group>, Flags<[DriverOption, CC1Option]>,
     HelpText<"Enable sample-based profile guided optimizations">;
+def fauto_profile_EQ : Joined<["-"], "fauto-profile=">,
+    Alias<fprofile_sample_use_EQ>;
 
 def fblocks : Flag<["-"], "fblocks">, Group<f_Group>, Flags<[CC1Option]>,
   HelpText<"Enable the 'blocks' language feature">;
index 8bf53e5e6dc38c96c2ae93c3041467a5de1490fc..70826d7299f3a829b48ef778add3344bfdbd22e4 100644 (file)
@@ -54,6 +54,9 @@
 // RUN: %clang -### -S -fprofile-sample-use=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-SAMPLE-PROFILE %s
 // CHECK-SAMPLE-PROFILE: "-fprofile-sample-use={{.*}}/file.prof"
 
+// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-AUTO-PROFILE %s
+// CHECK-AUTO-PROFILE: "-fprofile-sample-use={{.*}}/file.prof"
+
 // RUN: %clang -### -S -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
 // RUN: %clang -### -S -fno-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
 // RUN: %clang -### -S -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s